當我在Exchange PowerShell中的Exchange服務器上運行下面的代碼它顯示所有屬性:-ExpandProperty不通過遠程PowerShell顯示所有屬性
PS> Get-Mailbox Testeria | select -ExpandProperty EmailAddresses SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : smtp:[email protected] Prefix : SMTP IsPrimaryAddress : False PrefixString : smtp SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : SMTP:[email protected] Prefix : SMTP IsPrimaryAddress : True PrefixString : SMTP SmtpAddress : [email protected] AddressString : [email protected] ProxyAddressString : smtp:[email protected] Prefix : SMTP IsPrimaryAddress : False PrefixString : smtp
但是當我嘗試PowerShell中的遠程使用通過
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ("http://" + $Server + "/PowerShell/") -Authentication Kerberos
Import-PSSession $Session
本地計算機並運行相同的代碼,它顯示僅此:
PS> Get-Mailbox Testeria | select -ExpandProperty EmailAddresses smtp:[email protected] SMTP:[email protected] smtp:[email protected]
如何理解這種行爲?如何通過遠程PowerShell獲取所有屬性?在本地機器上
PSVersion是5.1.14409.1005
PSVersion Exchange Server上是4.0