Date created: 08/27/10 19:59:44. Last modified: 12/13/12 11:41:20

List Primary SMTP Addresses

I like to keep on top of unused accounts but its difficult when you don't know the user. I use this command to gather lists of primary SMTP addresses by domain name. This way I can email the lists to those in charge of of the users who belong to that domain and see who needs the boot:

Get-AcceptedDomain Get-Mailbox | where {$_.Primarysmtpaddress -like "*"} | fl Name,PrimarySMTPAddress >

With this I have a small powershell script about 8 lines long, one entry per domain for which I route mail. I run this bi-monthly or monthly and I'm done!