When I run the following code in Exchange PowerShell on an Exchange server it shows all the properties:
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
But when I try to use Remote PowerShell on the local machine via
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri ("http://" + $Server + "/PowerShell/") -Authentication Kerberos
Import-PSSession $Session
and run the same code it show only this:
PS> Get-Mailbox Testeria | select -ExpandProperty EmailAddresses smtp:[email protected] SMTP:[email protected] smtp:[email protected]
How to understand this behaviour? How to get all the properties via Remote PowerShell?
PSVersion on the local machine is 5.1.14409.1005
PSVersion on the Exchange Server is 4.0
EmailAddresses
objects turn to strings is the implicit recursion-depth limit that the remoting infrastructure applies to non-well-known (scalar) objects, which replaces property values that aren't themselves instance of well-known types with their.ToString()
values. – Candlemas