【发布时间】:2018-01-31 04:44:18
【问题描述】:
我尝试运行以下脚本以连接到 Exchange 服务器,但出现以下错误。剧本有什么问题吗?是否需要从服务器端进行任何更改?
Get-ExecutionPolicy
Set-ExecutionPolicy RemoteSigned
$LiveCred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://mail.company.tld/powershell/ -Credential $LiveCred -Authentication Basic -AllowRedirection
错误:
New-PSSession : [mail.deloitte.ca] Connecting to remote server mail.deloitte.ca failed with the following error message : The WinRM client sent a request to an HTTP
server and got a response saying the requested HTTP URL was not available. This is usually returned by a HTTP server that does not support the WS-Management protocol.
For more information, see the about_Remote_Troubleshooting Help topic.
At line:4 char:12
+ $Session = New-PSSession -ConfigurationName Microsoft.Exchange -Conne ...
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [New-PSSession], PSRemotingTransportException
+ FullyQualifiedErrorId : URLNotAvailable,PSSessionOpenFailed
【问题讨论】:
-
您应该从问题中的 URL 中删除公司名称。
-
服务器/客户端上运行的是什么Powershell版本?
标签: powershell