Getting ProxyAddresses from Get-ADuser in Powershell

This one for some reason always get’s me, and it always takes me longer than it should to find the answer… so if nothing else, this post is so I have quick access to the answer. To get the Proxyaddresses from the get-aduser cmdlet we can use the name and expression (or n= and  e=) pieces of Powershell. Proxy addresses cannot be pulled from Powershell directly as they are not a member of that command. The members of any command can be viewed by using the following:

get-aduser | get-member

Where get-aduser is replaced by whatever CmdLet you choose. So, now that we know it is not a member of that command, how do we extract the proxyaddress information from Powershell? …Use the -properties operator and the Name and Expression form to properly format the information.

This gets you the information:

get-aduser myuser -properties proxyaddresses

However, that doesn’t allow you to export that information… when trying the following:

get-aduser myuser -properties proxyaddresses | export-csv test.csv

You get garbage where you’d hope your proxy addresses would be. To resolve this, pull the property, and then call it into your csv:

get-aduser myuser -properties * | select-object name, samaccountname, surname, enabled, @{"name"="proxyaddresses";"expression"={$_.proxyaddresses}} | Export-Csv test.csv

To be clear, following “name=” can be anything you want… it will be the header for the information you are calling. The “expression=” is calling the actual value. $_. is what is allowing you to access the value of “proxyaddresses” in the array. Using this command, you should now have a CSV that can be viewed, or imported to another CMDLet.

Still Learning Powershell? It’s a bit spendy, but as in most things technology, with this book, you get what you pay for.


  1. Thanks so much for this. Got to you webpage on my first Google search. Saved me huge amount of time trying to figure this out or searching through numerous blogs.

Leave a Reply

Your email address will not be published. Required fields are marked *