Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Management With PowerShell

Finding Which User Has A Specific Email Address by markdmac
Posted: 14 Feb 08 (Edited 19 May 09)

markdmac's Exchange 2007 Troubleshooting Tips
By Mark D. MacLachlan, The Spider's Parlor

A common scenario in business is you are asked to add an email address to a particular user.  You try to do so and receive a message that the address is already in use, but you are not told WHICH user has the mailbox.

Back in the Exchange 2003 days I could find this fairly easily with about 20 lines of vbscript code.  Finding the same solution in PowerShell was eluding me.

So after a bunch of reading and research I finally have the solution.  This is so much easier in PowerShell since it is only one command.  Now if I could just get passed my mental blocks on finding the commands....

The below code will find and report which user mailbox has the email id "searchuser@company.com", so just replace the email address with the address you are searching on.


(Get-Mailbox | ? {$_.EmailAddresses -match "^smtp:searchuser@company.com"}).name

In really large organizations you will need to specify to use a larger result set.  to do so use the following command.


(Get-Mailbox -ResultSize Unlimited | ? {$_.EmailAddresses -match "^smtp:searchuser@company.com"}).name

Happy scripting!

Back to Microsoft: Exchange FAQ Index
Back to Microsoft: Exchange Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close