Export-PSSession不导出任何cmdlet

时间:2018-01-26 16:28:05

标签: powershell exchange-server powershell-v5.0

我正在尝试使用Export-PSSession导出远程Microsoft Exchange会话但是当我执行此操作时,在导入模块时没有导入任何Exchange特定cmdlet,只有Exchange特定计数器有效。这就是我到目前为止所做的:

$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://my.exchange.server.name.and.domain/PowerShell/ -Authentication Kerberos -Credential administrator
Export-PSSession -Session $Session -OutputModule ExchangeCmdlets -CommandType All -CommandName * -AllowClobber -Force
Import-Module -name ExchangeCmdlets
Get-ExchangeServer

我觉得我很亲密但却遗失了什么。

1 个答案:

答案 0 :(得分:0)

您可以在-PSSession cmdlet中尝试Import-Module参数。

Import-Module -PSSession $Session