"DistinguishedName","Enabled","GivenName","Name","ObjectClass","ObjectGUID","proxyaddresses","SamAccountName","SID","Surname","UserPrincipalName"
"CN=jondoe,DC=contoso,DC=com","True","Jon","jondoe","user", "00000000-000-0000000", "Microsoft.ActiveDirectory.Management.ADPropertyValueCollection", "jondoe","S-1-5-21-00000-00000-0000000-00000",,"jondoe@contoso.com"
The problem is while most attributes like DistinguishedName, Enabled, GivenName, etc. are simple text value, ProxyAddresses shows up as an ADPropertyValueCollection. Showing me its type does not help.
Here's a quick and dirty way I use to address this issue:
Get-ADUser jondoe -Property ProxyAddresses | select Name,UserPrincipalName,@{n="ProxyAddresses";e={$_.ProxyAddresses -join "|"}}You can change the "|" character to anything you like, but you get the idea. It works just like magic!
No comments:
Post a Comment