我试图从使用Windows PowerShell的远程计算机连接“Exchange Server 2007”。这是我的方式。Powershell交换服务器
$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是远程计算机名称还是域名? –
如果您在远程计算机上本地尝试代码而未指定凭据,该怎么办? –