我无法通过远程PowerShell会话运行Exchange 2010 cmdlet。
我以pipe理员身份启动本地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
如您所见,没有任何Exchange cmdlet正在运行。 可能是什么问题?
您正尝试连接到Exchange Server上的默认远程端点,并从那里添加ps snapin。 这是错误的。 用你的第一个3行代替:
$mailcred = Get-Credential $mailSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://MAILSRV/PowerShell/ -Credential $mailcred Import-PsSession $mailSession
您不必input会话,而是将其导入到本地会话中。 从这里开始,您可以在本地使用特定于Exchange的CmdLets。 此外,某些Exchange .Nettypes与Exchangepipe理控制台一起安装,所以如果要使用邮箱大小进行安装,则需要在本地计算机上安装(Exchange使用它自己的大小对象types)
你可以这样做,使用import-pssesion并指定connectionURI和ConfigurationName。
PS U:\> $cred = Get-Credential PS U:\> $session = New-PSSession -ConnectionUri http://Exchange01/powershell -ConfigurationName Microsoft.Exchange -Credential $cred PS U:\> Import-PSSession $session PS U:\> Get-Mailbox marius.davidsen Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- Marius Davidsen Marius.Davidsen Exchange01 unlimited
这要求您在防火墙中允许tcp端口80。
使用该会话,你也可以像你想要的那样input它:
PS U:\> Enter-PSSession $session [Exchange01]: PS> get-mailbox [Exchange01]: PS> get-mailbox marius.davidsen Name Alias ServerName ProhibitSendQuota ---- ----- ---------- ----------------- Marius Davidsen Marius.Davidsen Exchange01 unlimited
我曾经有同样的问题。 我认为解决的办法是这样的:
$s=new-pssession -computername xxxxx import-pssession -session $s
然后添加您的pipe理单元,并运行您的命令
来源: http : //forums.veeam.com/viewtopic.php?f=2&t=7514
您是否尝试从DVD安装Exchangepipe理工具并configuration您的工作站?
我build议使用远程端点,这是正常交换安装的一部分。 你可以在这里find更多的细节
我已经在EX 2010和EX 2013中成功地使用了它。它支持的方式和遵循RBAC规则,所以我build议使用它,而不是将Exchange捕捉添加到“正常”远程端点。
问题是两台机器应该在同一个域中。
另外请确保您使用域帐户,而不是本地帐户。