【发布时间】:2011-10-04 05:33:08
【问题描述】:
我正在尝试使用 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.
我在这里使用的凭据是我的系统凭据。
【问题讨论】:
-
isshyd 是远程计算机名还是域名?
-
如果您在远程计算机上本地尝试代码而不指定凭据会怎样?
标签: c# powershell powershell-2.0 exchange-server exchange-server-2007