I am looking for the property primarysmtpaddress, get-aduser has a property called mail but this returns the proxyaddress – how do I get the primarysmtpaddress without using the exchange or quest cmdlets?
The ActiveDirectory cmdlets don't know anything about Exchange extensions, so you'd have to access the LDAP properties directly. I haven't worked with Exchange much, but based on this link, it looks like the "primary SMTP Address" is part of the proxyAddresses multi-valued attribute. Specifically, it's the element that begins with "SMTP:" in upper-case.
Thanks for the quick response guys, I can select the property ProxyAddress but how to only output the primary SMTP address,
perhaps I am focusing on the wrong cmdlet, I can get the value pretty easily using the quest cmdlets
Get-ADUser doesn't return a PrimarySMTPAddress object. The only way to get it is to retrieve the entry in the ProxyAddress array with the case sensitive 'SMTP' string. Dave's suggestion looks like a good way to proceed.