带有 Exchange 2010 的 PowerShell 远程处理:值不能为空

pk.*_*pk. 8 powershell exchange-2010

我无法通过远程 PowerShell 会话运行 Exchange 2010 cmdlet。

我以管理员身份启动本地 PowerShell 会话并发出以下命令——

PS C:\Windows\system32> $mailcred = Get-Credential
PS C:\Windows\system32> $mailSession = New-PSSession -ComputerName MAILSRV -Credential $mailcred
PS C:\Windows\system32> Enter-PSSession $mailSession
[MAILSRV]: PS C:\Users\jdoe\Documents> Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010
[MAILSRV]: PS C:\Users\jdoe\Documents> hostname
MAILSRV
[MAILSRV]: PS C:\Users\jdoe\Documents> Get-ExchangeServer
Value cannot be null.    
Parameter name: serverSettings
    + CategoryInfo          : 
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Exchange.Management.SystemConfigurationTasks.GetExchangeServer

[MAILSRV]: PS C:\Users\jdoe\Documents> get-mailbox
Value cannot be null.    
Parameter name: serverSettings
    + CategoryInfo          : 
    + FullyQualifiedErrorId : System.ArgumentNullException,Microsoft.Exchange.Management.RecipientTasks.GetMailbox
Run Code Online (Sandbox Code Playgroud)

如您所见,所有 Exchange cmdlet 都不起作用。可能是什么问题?

nor*_*ben 0

我曾经遇到过同样的问题。我认为解决方案是这样的:

$s=new-pssession -computername xxxxx
import-pssession -session $s
Run Code Online (Sandbox Code Playgroud)

然后添加您的管理单元,并运行您的命令

来源:http ://forums.veeam.com/viewtopic.php?f=2&t=7514