从powershell 2.0连接到本地Exchange 2007

时间:2013-04-17 14:49:52

标签: powershell exchange-server winrm

我正在尝试从PowerShell连接到Exchange 2007(两者都在同一台计算机上)。

我错过了什么?

我的代码:

Set-ExecutionPolicy  RemoteSigned  

$cred = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri         
https://localhost/powershell/ -Credential $cred -Authentication Basic –AllowRedirection
Import-PSSession $Session  

我得到的错误:

[localhost] Connecting to remote server failed with the following error message : The server certificate on the destination computer (localhost:443) has the following errors:      
The SSL certificate is expired. For more information, see the about_Remote_Troubleshooting Help topic.
    + CategoryInfo          : OpenError: (System.Manageme....RemoteRunspace:RemoteRunspace) [], PSRemotingTransportException
    + FullyQualifiedErrorId : PSSessionOpenFailed
Import-PSSession : Cannot validate argument on parameter 'Session'. The argument is null. Supply a non-null argument and try the command again.
At line:3 char:17
+ Import-PSSession <<<<  $Session
    + CategoryInfo          : InvalidData: (:) [Import-PSSession], ParameterBindingValidationException
    + FullyQualifiedErrorId : ParameterArgumentValidationError,Microsoft.PowerShell.Commands.ImportPSSessionCommand

1 个答案:

答案 0 :(得分:1)

远程处理不适用于Exchange 2007.从来没有。