我正在尝试使用Windows PowerShell从远程计算机连接“Exchange Server 2007”。这就是我的方式。
$server = '192.168.1.61';
$pwd = convertto-securestring '123' -asplaintext -force;
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist 'isshyd\Administrator', $pwd;
invoke-command -computername $server -credential $cred -scriptblock { Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin;Get-MailboxDatabase | ft Name }
但是当我运行此查询时,我收到类似这样的错误
Active Directory server "machine name" is not available.
The supplied credential is invalid.
我在这里使用的凭证是我的系统凭证。
答案 0 :(得分:0)
您是否负责此文档信息。
“要在ComputerName参数的值中使用 IP地址,该命令必须包含Credential参数。此外,必须为计算机配置HTTPS传输或IP地址远程计算机必须包含在本地计算机上的WinRM TrustedHosts列表中。有关将计算机名称添加到TrustedHosts列表的说明,请参阅about_Remote_Troubleshooting中的“如何将计算机添加到受信任主机列表”。“< / p>