In our sample (simple) Query, we're looking for all of the Exchange mailbox "proxyaddresses" for a single specific user.
Note how all the values we're looking for are present.
Note how the multi-valued attributes (in this case, "proxyaddresses") show up in the CSV. We only get "System.String". Booo!
By replacing each multi-valued attribute with a join function, we can have Powershell create a single string, using any character we specify to concatenate the values. In my examples, example, I'm using semicolons.
Note: this is exactly the same command , using better user ("seth") to illustrate results.
Result: all "proxyaddresses" values concatenated by semicolons.
This can be extremely useful if you're trying to retire an SMTP relay service, for example -what messages are going through this server?
Ben is the Vice President of Engineering at Miller Systems.
Then this imports the created .csv back in..
I used these to copy attributes across to a new domain after using ADMT to migrate users and passwords. The client is using Office 365 and no longer wanted to maintain Exchange.
I wanted to export Multi-Value Properties such as MemberOf, ProxyAddresses, etc., I am able to do it either by using Join() or creating custom object array.
The problem is I need these multi-value property exported in one cell in multiple lines in CSV.
Any positive answers much appreciated.
And it ends it with a dash.. $FormatEnumerationLimit =-1 didn't help. Thanks!
Is it possible to use one-liner query to make output from the "get-messagetrackinglog" example above with single recipient on each line ?
First thanks for this very detailed explanation it was super helpful.
I'm wondering if I can't ask for a tip on how to use this exported data, specifically the Proxy addresses. We've found we need to export all distribution groups from our legacy exchange, remove them & then re-create them with the same attributes in O365.
Long story short this has been a bit of a nightmare.
I'm wondering if you know of a way to import the proxy address field exported above in such a way that I wont have to reformat it? Or failng that another approch to export the proxy addresses so that it will place nice with "Set-DistributionGroup -Identity $group.DisplayName -EmailAddresses"?
Glad you found your answer! Thanks for stopping by and happy to hear that you found the post useful.
Thank you Very much, Awesome article!!
It would be great if there was a way to retrieve individual values from multivalued properties, but I don't think this is it.
I've tried 'get-aduser -properties proxyaddresses' and 'get-aduser -properties *', but no dice.
Is there a special config needed for Powershell for this? I find it odd that others report this working, yet when I run the identical command, nope.
This does not work for me at all. Powershell 4.0 on Windows 8.1.
I'd be interested in understanding why the difference, as I encounter this problem frequently. It's hard to customize to fit my own solutions without understanding why or when or which works.
I had the same problem, copied you and it worked great.
It doesn't pull the Primary group of the user (and will return blank if the user is only in one group). At least not in older versions of powershell.
in order to perform say a foreach loop against each one.
I've been working with this type of thing a lot lately. Very useful and very powerful when used correctly! I know it's saved me tons of time! One thing that I would recommend when using Export-Csv is to use the -NoTypeInformation parameter which will spit out the same csv file but without the "#Type.bla.bla.bla" header information so you can save a step in having to delete it in the spreadsheet.
Just a nice little tip I've learned while working with PowerShell. I hope this info come in handy in your PowerShell travels!