I am attempting to manage Skype Online for Business via the LyncOnlineConnector
PowerShell module. I have had no trouble whatsoever connecting to remote exchange. However, I am now trying to do the exact same thing using New-CsOnlineSession
rather than New-PSSession
(used to connect to o365).
Importing the lync connector works fine. However, when I try to build the session (verbose):
VERBOSE: Determining domain to admin
VERBOSE: AdminDomain = 'x.com'
VERBOSE: Discovering PowerShell endpoint URI
VERBOSE: TargetUri = 'https://admin1a.online.lync.com/OcsPowershellOAuth'
VERBOSE: GET https://admin1a.online.lync.com/OcsPowershellOAuth with 0-byte payload
VERBOSE: AuthUri = 'https://login.windows.net/common/oauth2/authorize'
VERBOSE: Requesting authentication token
VERBOSE: Success
VERBOSE: Initializing remote session
New-PSSession : [admin1a.online.lync.com] Connecting to remote server admin1a.online.lync.com failed with the
following error message : The client cannot connect to the destination specified in the request. Verify that the
service on the destination is running and is accepting requests. Consult the logs and documentation for the
WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service,
run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig". For more
information, see the about_Remote_Troubleshooting Help topic.
At C:\Program Files\Common Files\Skype for Business
Online\Modules\SkypeOnlineConnector\SkypeOnlineConnectorStartup.psm1:147 char:16
+ $session = New-PSSession -ConnectionUri $ConnectionUri.Uri -Credential $cred ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotin
gTransportException
+ FullyQualifiedErrorId : CannotConnect,PSSessionOpenFailed
What perplexes me is that I had this same issue with exchange initially, however setting the execution policy (remote force) and running winrm quickconfig
seemed to fix everything.
I've tried every suggestion related to winrm I can find, but nothing seems to change this error. I've opened ports, run the command as different users / admin, recreated the session often, ran the commands here, as well as numerous other things from the 'net that I can't remember anymore. Nothing changes my results at all.