我正在尝试使用PowerShell通过wsman连接连接到Exchange服务器。所讨论的客户端服务器位于工作组中,而Exchange服务器位于其自己的域中。
我使用以下命令尝试连接到服务器:
connect-wsman -connectionuri http://servername/PowerShell -credential domain\administrator然后我得到了完整的错误:
连接到远程服务器失败,有以下错误消息: WinRM客户端无法处理请求。它无法从目标计算机确定HTTP响应的内容类型。内容类型不存在或无效。有关更多信息,请参见about_Remote_Troubleshooting帮助主题。
以前,当所讨论的客户端服务器与Exchange服务器位于同一域中时,此操作是有效的。防火墙关闭,所有服务器相对于TrustedHosts都是WinRM。
有趣的是,当我用:
connect-wsman -computername servername -credential domain\administrator我没有任何错误。但是,我需要能够使用URI而不是计算机名。
有什么想法吗?
发布于 2018-07-26 08:50:26
要在exchange服务器上工作,我使用另一种将New-PSSession与Import-PSSession结合使用的方法在本地加载远程交换函数。
$PSExchSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri "http://$($Exch.dNSHostName)/PowerShell/" -Credential (Get-CredentialByRegistry "$AD\Administrateur") -Authentication Kerberos
Import-PSSession $PSExchSession -CommandName 'Get-Mailbox','Get-MailboxStatistics','Get-ActiveSyncDeviceStatistics' -AllowClobberhttps://stackoverflow.com/questions/24090954
复制相似问题