Tuesday, October 8, 2013

Connecting to Lync Online via Powershell

In previous posts I’ve details how to connect to Office 365 administration using PowerShell:

http://blog.ciaops.com/2012/09/configuring-power-shell-access-in.html

I’ve also detailed how to connect to SharePoint Online using PowerShell:

http://blog.ciaops.com/2013/05/connecting-powershell-to-sharepoint.html

So now I’ll show you how to connect to Lync Online with PowerShell.

The first thing you should do is follow the initial blog post:

http://blog.ciaops.com/2012/09/configuring-power-shell-access-in.html

to ensure the Microsoft Online Assistant and the Microsoft Online Services Module for Windows PowerShell are installed.

image

As with SharePoint Online you are going to need to have PowerShell V3 installed before using Lync Online with PowerShell. If you are doing this on a Windows 8 desktop, then PowerShell V3 is already installed. If not, then you are going to need to download and install Windows Management Framework 3.0 which includes PowerShell 3.0.

Next you’ll to install the Lync Online Management Shell. This is located here:

http://www.microsoft.com/en-us/download/details.aspx?id=39366

image

Accept the license terms and conditions and press the Install button to commence.

image

Accept the UAC and select Yes to continue.

image

The installation will check to see what software is installed on your system.

image

image

image

All going well the installation should complete successfully. Select the Close button to complete the process.

image

Once you have all that installed run the Microsoft Online Services Module for Windows PowerShell as an administrator.

clip_image002

Accept the UAC by pressing Yes.

The next step is to load in the Lync Online cmdlets for use in this session. These cmdlets are called:

lynconlineconnector

So at the PowerShell prompt type:

clip_image004

import-module lynconlineconnector

If you haven’t already logged into your Office 365 tenant as an administrator using PowerShell command you will need to do as detailed in previous posts using the command:

clip_image006

$cred=get-credential

Next, use the following commands to connect to the Lync Online Service.

clip_image008

$session = New-CsOnlineSession -Credential $cred

clip_image010

Import-PSSession $session

You should notice a banner appear across the top of the window as the modules are loaded as shown above.

clip_image012

If everything is correct, PowerShell will simply be returned to a prompt. Now you can execute commands against Lync Online. For example the following will display your Lync tenant information:

clip_image014

get-cstenant

Now you can start exploring all the cmdlets that are available for Lync Online which you can find at:

http://technet.microsoft.com/en-us/library/jj994021.aspx