在PowerShell中使用反序列化的Exchange 2013 PSSession

时间:2017-08-23 07:31:12

标签: powershell exchange-server exchange-management-shell

我为Exchange 2013服务器创建了New-PSSessionConnectionUri,但是看到会话的类型是Deserialised。 {(1}},Invoke-CommandEnter-PSSession无法使用此反序列化的会话。

如何使用Import-PSSession Deserialised?我的目标是查看Exchange服务器的PSSession

以下代码:

Get-Queue

引发以下错误:

$UserCredential = Get-Credential
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<fqdn of exchange server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
#Cannot convert session to non-Deserialized type
Enter-PSSession -session $Session
#Cannot convert session to non-Deserialized type
Import-PSSession -session $Session
#Cannot convert session to non-Deserialized type
icm -session $Session -ScriptBlock {Get-queue}

0 个答案:

没有答案