Connecting to Skype for Business Online in Hybrid with Powershell

Trying to conenct to Skype for Business Online with Powershell in a Hybrid environment? Running into Get-CsPowerShellEndpoint : Unable to connect to the remote server?

Fear not, here is the solution :)

tldr: problem with the way autodiscover works in hybrid. You need to -OverrideAdminDomain to domain.onmicrosoft.com.

Here is what you need to connect:

  1. The SkypeOnline Powershell-module. The easiest way as of now is to get it from https://www.microsoft.com/en-us/download/details.aspx?id=41950 (I didn't find it on the PsGallery).
  2. Connect by: $SkypeOnlineSession = New-CsOnlineSession -Credential $Creds -OverrideAdminDomain "domain.onmicrosoft.com" (remember my old post for handling the credentials: Some neat Powershell-snippets for connecting to Office 365 and Exchange Online (and managing credentials)).
  3. Import the session: Import-PSSession $SkypeOnlineSession
  4. Do some magic: Get-CSOnlineUser a.random.name

Enjoy! ;)

Andreas Selevik

Andreas Selevik

Solution Architect specialized in Windows & Azure Architecture, Office 365, PowerShell, Identity management and automation. Manchester United fanatic, father, husband and a very good winner...

Read More