By using this site, you agree to the Privacy Policy.
Accept
EnterinITEnterinITEnterinIT
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
Reading: PowerShell unable to connect to Skype for Business Online
Font ResizerAa
EnterinITEnterinIT
Font ResizerAa
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
  • WINDOWS
  • SCCM Query Collection List
Search
  • HOME
  • IT PRO
  • TECH
  • MICROSOFT
    • Azure
    • ConfigMgr/SCCM
    • DPM
    • Orchestrator
    • Hyper-V
    • Microsoft Edge Insider
    • MSI
    • Office 365
    • Office Insider
    • Power BI
    • Skype
    • SQL Server
    • Teams
  • WINDOWS
    • Windows Admin Center
    • Windows Client
    • Windows Server
  • SCCM Query Collection List
IT Pro

PowerShell unable to connect to Skype for Business Online

Published: February 11, 2024
2 Min Read
SHARE

PowerShell is unable to connect to Skype for Business Online in a hybrid environment. To Connect to Skype for Business PowerShell commonly use:

Import-Module SkypeOnlineConnector
$Cred = Get-Credential
$Session = New-CSOnlineSession -credential $Cred

Or (with all tools installed):

#cred = Get-Credential
$session = New-CsOnlineSession -Credential $cred
Import-PSSession $session

But, Administrators who have a Skype for Business hybrid deployment may receive the following error message when they try to connect to Skype for Business Online Remote PowerShell:

Get-CsPowerShellEndpoint : The remote server returned an error: (503) Server Unavailable.
At C:\Program Files\Common Files\Skype for Business
Online\Modules\SkypeOnlineConnector\SkypeOnlineConnectorStartup.psm1:94 char:26

+ …      $targetUri = Get-CsPowerShellEndpoint -TargetDomain $adminDomain
+                       ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo          : NotSpecified: (:) [Get-CsPowerShellEndpoint], WebException
+ FullyQualifiedErrorId : System.Net.WebException,Microsoft.Rtc.Management.OnlineConnector.GetPowerShellEndpointCmDlet

This is expected behavior for a Hybrid environment and the issue occurs when the DNS records for LyncDiscover are pointed to the on-premises Skype for Business environment.

To resolve this issue, run the cmdlet again, but instead, add the -OverrideAdminDomain parameter. Use the default domain that was included with your Office 365 subscription; for example, use name.onmicrosoft.com:

Import-Module SkypeOnlineConnector
$Cred = Get-Credential
$Session = New-CSOnlineSession -credential $Cred -OverrideAdminDomain “name.onmicrosoft.com”

These easy steps have now provided remote PowerShell access to the connected Skype for Business Online. To test connectivity simply try running  Get-CsUser.

TAGGED:Microsoft Office 365Skype for Business
Previous Article How to Fix NPS Server Authentication Failed Due to User Credentials Mismatch
Next Article Configuration Manager Query Collection List SCCM Current Branch 1706 KB4036267
1 Comment 1 Comment
  • Justin Harper says:
    May 20, 2020 at 12:15 pm

    You my friend are a legend! Just the command I needed!!

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Translation

English中文(简体)DanskNederlandsFrançaisDeutschItaliano한국어PolskiPortuguêsRomânăEspañolУкраїнська
by Transposh - translation plugin for wordpress

Popular Posts

System Requirements for Windows Server 2016
Windows Server
Configuration Manager Query Collection List
Configuration Manager Query Collection List
ConfigMgr
Structured/Managed Navigation enabled on Modern Pages in Classic Team Sites
Tech
SCCM Failed to get DP locations as the expected version from MP
ConfigMgr

Recent Posts

Installing and Configuring Fail2ban for SSH Protection on Ubuntu 24.04
Linux
Enabling and Configuring FirewallD on AlmaLinux
Linux
User Creation and SSH Key Setup in AlmaLinux
Linux
How to reset password on AlmaLinux
Linux

© 2023 EnterinIT

Go to mobile version
Welcome Back!

Sign in to your account

Username or Email Address
Password

Lost your password?