无法连接到Skype Online for Business – “winrm”问题

我试图通过LyncOnlineConnector PowerShell模块pipe理Skype Online for Business。 我没有任何连接远程交换的麻烦。 但是,我现在正在尝试使用New-CsOnlineSession而不是New-PSSession (用于连接到o365)完全相同的事情。

导入lync连接器工作正常。 但是,当我尝试构build会话(详细)时:

 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 

让我感到困惑的是,我最初与交换有同样的问题,但是设置执行策略(远程强制)并运行winrm quickconfig似乎解决了所有问题。

我试过每一个关于winrm的build议,我可以find,但似乎没有改变这个错误。 我已经打开了端口,以不同的用户/pipe理员身份运行命令,经常重新创build会话, 在这里运行命令以及来自'我不记得了'的networking的其他许多事情。 没有什么改变我的结果。

首先,除了安装了S4B Online Windows PowerShell模块v6.0.9276以外,这是让我无需任何额外设置即可连接的方法。

这是Technet的简短指南

 $sfboSession = New-CsOnlineSession -Credential $credential Import-PSSession $sfboSession 

这让我连接没有错误:

PowerShell连接到Skype for Business Online

从外观上看,它可能是networking数据包检测或SSL代理破坏SSL(就像在思科ASA上打开SMTP检查,破坏Exchange TLS连接一样)。

可以使用-SessionOption参数运行New-CsOnlineSession来提供代理设置信息。 使用从系统configurationinheritance的代理设置configuration会话:

 $proxysettings = New-PSSessionOption -ProxyAccessType WinHttpConfig New-CsOnlineSession -Credential $credential -SessionOption $proxysettings Import-PSSession $sfboSession 

New-PSSessionOption cmdlet还有更多的代理选项,包括authentication机制和凭证。