Finding email address for multiple users
Hello gurus, I have say 100 users and I would like to know all their email address. Is there a cmdlet that can export all the email addresses into a log file? Please advise. Thanks a lot.Never stop learning
September 27th, 2011 8:45pm

On Tue, 27 Sep 2011 17:45:45 +0000, OneWay85 wrote: >I have say 100 users and I would like to know all their email address. Is there a cmdlet that can export all the email addresses into a log file? Try this (all on one line): get-mailbox | select displayname,@{n='ProxyAddresses';e={$_.emailaddresses}} | export-csv -path addr.csv -notypeinfo --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2011 6:09am

Thanks, Rich Matheisen. Does that require me to prepare a csv file so that I can query and export all the email addresses in one go?Never stop learning
September 28th, 2011 6:32am

On Wed, 28 Sep 2011 03:32:14 +0000, OneWay85 wrote: >Does that require me to prepare a csv file so that I can query and export all the email addresses in one go? Nope. The get-mailbox will get all of them. If you have more than 1000 mailboxes you'd have to add the "-resultsize unlimited" to the get-mailbox cmdlet. You can use the resulting CSV to find the users. If you wanted to find _just_ those 100 users from among all of the mailboxes you'd have to control the get-mailbox. If you had a file with alias names in it you could use something like this: $a = get-content inputfile.txt get-mailbox | where {$a -contains $_.alias} | select displayname,@{n='ProxyAddresses';e={$_.emailaddresses}} | export-csv -path addr.csv -notypeinfo Just change the 'where' is you want to use displaynames or some other property. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
September 28th, 2011 7:27pm

Thank you very much for being so kind and helpful, I will have a go at it later and let you know the result. :) PS: what shall I do if I only have a list of names (LastName, FirstName)? Never stop learning
September 28th, 2011 8:20pm

On Wed, 28 Sep 2011 17:20:00 +0000, OneWay85 wrote: > > >Thank you very much for being so kind and helpful, I will have a go at it later and let you know the result. :) > > > >PS: what shall I do if I only have a list of names (LastName, FirstName)? That depends on how you name your mailboxes. If they're named "Firstname Lastname" or "Lastname, Firstname" you add to the acript to manipulate the contents of the file to format the contents before storing it in the $a variable. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
Free Windows Admin Tool Kit Click here and download it now
September 29th, 2011 1:23am

On Wed, 28 Sep 2011 17:20:00 +0000, OneWay85 wrote: > > >Thank you very much for being so kind and helpful, I will have a go at it later and let you know the result. :) > > > >PS: what shall I do if I only have a list of names (LastName, FirstName)? That depends on how you name your mailboxes. If they're named "Firstname Lastname" or "Lastname, Firstname" you add to the acript to manipulate the contents of the file to format the contents before storing it in the $a variable. --- Rich Matheisen MCSE+I, Exchange MVP --- Rich Matheisen MCSE+I, Exchange MVP
September 29th, 2011 1:23am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics