Connecting to Skype for Business Online with PowerShell

This article explains how to connect to Skype for Business Online with PowerShell.

Prerequisites

You need to be a Global Administrator in the Office 365 Tenant, or at the least be assigned to the Skype for Business administrator role.

You need to be using a 64-bit version of one of the following Windows OS:

  • Windows 10
  • Windows 8 or 8.1
  • Windows 7 SP1
  • Windows Server 2016
  • Windows Server 2012 R2
  • Windows Server 2012
  • Windows Server 2008 R2 SP1

You need to install Microsoft .NET Framework 4.5.x, and either Windows Management Framework 3.0 or 4.0.

The following modules are required:

Configure PowerShell to run signed scripts for Skype for Business Online.  Run the following in an elevated PowerShell session:

Set-ExecutionPolicy RemoteSigned

Connect to Skype for Business Online

Create a PowerShell credentials object:

$credential = Get-Credential

SfBOnlineConnect1

A dialog box will appear to enter your credentials. Enter your username and password, then click OK.

Import the Skype for Business Online module:

Import-Module SkypeOnlineConnector

When the module has been imported, run the following command:

$sfboSession = New-CsOnlineSession -Credential $credential

Although a connection has been established to Office 365, it’s necessary to run the following command to download scripts, cmdlets, etc. to manage Skype for Business Online:

Import-PSSession $sfboSession

SfBOnlineConnect2

Close the Connection

When you’re done, closing the PowerShell window will leave the remote connection to Skype for Business Online active for the next 15 minutes. It’s good practice to end the session when you’re done.

Remove-PSSession $sfboSession

 

4 comments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s