powershell

Find Email Address in Exchange Org

Have you ever had a tough time finding where an email address exists in your Exchange Org. Often times this comes from have a forward on a mailbox or a contact set to an external address. If you run the following in your Exchange Management Shell, you should be able to find almost any address or portion of address in your org. I like to format the output too, so you can change the | format-table part to however you would like the output to read.


get-recipient -filter {emailaddresses -like "Pattern goes here"}|format-table name,recipienttype,emailaddresses

How Many Exchange Mailboxes

Have you ever wondered how many mailboxes you have in your Exchange org? Well, if you have Exchange 2007 installed (not even any mailboxes migrated yet) you can fire up the Exchange Management Shell and throw down the following.

get-mailbox|measure-object

That simple!

Multiple Primary SMTP Addresses

Happy 2009 Everyone!

Here at work we have an automated system to create accounts based on data from our ERP system. We noticed after migrated many users to Exchange 2007 from Exchange 2003, that the newly migrated users could not send to users who had forwarded their accounts using UI to our account management system. The error complained of the contact having multiple primary SMTP addresses. Here's the little Powershell code snippet I ran to fix the issue.


foreach ($contact in get-mailcontact -resultsize unlimited){