Can you be more clear about what you want to have when you are done? A list of email addresses? Do you want to use PowerShell to access Exchange, or just to manipulate Excel data? Do you want to dump all the email addresses in the system to an Excel spreadsheet? Or just certain addresses, based on the Excel data?
The answer to all of those is yes, there is a way.
Sorry, I was given an excel spreadsheet with 200 usernames. They want the email addresses of all 200 users. These users are spread out over a couple domains and OU's. To go through and manually type this would be very time consuming. I was hoping there was some way with powershell.
First create a file called userlist.csv with a single column. The first row should have the word Alias, the rest should be the usernames. Usernames should be the same as their aliases.
Then run this:
Code:
import-Csv userlist.csv | %{Get-Mailbox $_.Alias} | ft displayname,primarysmtpaddress
That will display all the users full names and primary email addresses.
If you want it all exported to another .csv file, you can do this:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.