Smart questions
Smart answers
Smart people
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Member Login

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips now!
  • 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!

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

LINK TO THIS FORUM!

Add Stickiness To Your Site By Linking To This Professionally Managed Technical Forum.
Just copy and paste the
code below into your site.

Partner With Us!

"Best Of Breed" Forums Add Stickiness To Your Site
Partner Button
(Download This Button Today!)

Feedback

"...Within the first afternoon I found 2 of the 3 needed solutions, and the 3rd came to me over the weekend!..."

Geography

Where in the world do Tek-Tips members come from?

Management With PowerShell

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

markdmac's Exchange 2007 Troubleshooting Tips
By Mark D. MacLachlan, The Spider's Parlor
http://www.thespidersparlor.com


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.

CODE

(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.

CODE

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


Happy scripting!

Back to Microsoft: Exchange 2007 FAQ Index
Back to Microsoft: Exchange 2007 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