In this techtip, we’ll set the foundation for a couple of future articles on leveraging Powershell to work with (and troubleshoot) Lync Online. There are a couple of cmdlets that have to be installed and bolted up to Powershell locally in order to be able to connect to and work with the Lync Online service. We’re fortunate enough that Microsoft has bundled these up into a single, self-installing package that does the majority of the hard work for us.
.: The admin user you’re logging in with needs to be SIP enabled – meaning that they must have a license assigned to them that includes Lync Online.
.: The tenant (domain) you’re logging into must have their lyncdiscover DNS records set properly.
Step 1: Download and install the Lync Online cmdlets. You can download the installer HERE.
Step 2: Once that’s finished, connect to 365 using my steps in the aforementioned article. (I’ll list the commands below, but note that it’s not exactly necessary to start a full session to 365 this way to get access to Lync Online. But for the purposes of avoiding backtracking, I prefer to establish all the necessary connections up front in the event that there are other cmdlets that you want to run.)
$365Credentials = Get-Credential
$365Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://ps.outlook.com/powershell/ -Credential $365Credentials -Authentication Basic -AllowRedirection
$LyncSession = New-CsOnlineSession -Credential $365Credentials
Voila! If you’re able to run all of those commands without an error, you are now connected to Lync Online with Powershell!