Powershell交换服务器
我正在尝试使用 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.
我在这里使用的凭据是我的系统凭据。
I am trying to connect "Exchange Server 2007" from a remote machine using windows powershell. This is how I do.
$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 }
but when I run this query I am getting an error like this
Active Directory server "machine name" is not available.
The supplied credential is invalid.
The credential I used here is my system credential.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否保管好此文档信息?
“要在 ComputerName 参数的值中使用IP 地址,命令必须包含 Credential 参数。此外,计算机必须配置为 HTTPS 传输或远程计算机的 IP 地址必须包含在本地计算机上的 WinRM TrustedHosts 列表中 有关将计算机名称添加到 TrustedHosts 列表的说明,请参阅 about_Remote_Troubleshooting 中的“如何将计算机添加到受信任主机列表”。
Do you take care of this documentation information.
"To use an IP address in the value of the ComputerName parameter, the command must include the Credential parameter. Also, the computer must be configured for HTTPS transport or the IP address of the remote computer must be included in the WinRM TrustedHosts list on the local computer. For instructions for adding a computer name to the TrustedHosts list, see "How to Add a Computer to the Trusted Host List" in about_Remote_Troubleshooting."