Searching for Additional SMTP Address

so i have an email email provided to me but when i search in ADUC or EMC i cant find the user who is using that email address. i had these problem before and it seems if its not the primary address i can search for it other then manually?
LVL 2
Jorge OcampoAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Simon Butler (Sembee)ConsultantCommented:
This should allow you to find it:

Get-Recipient -resultSize unlimited | select name -expand emailAddresses | where {$_.smtpAddress -match "user@example.com"} | Format-Table name, smtpaddress

Then do

get-recipient name

(where name is the name returned by the result from the first command).

Simon.
LazarusCommented:
That will work well, You can also use a little free tool that does a whole lot for you. Its called AD Info Free. http://www.cjwdev.co.uk/Software/ADReportingTool/Info.html
If you run a query on All Users it will tell you everything about every user in your AD. You can choose the amount of detail you want.
Jorge OcampoAuthor Commented:
i ran the command and stilll get object X couldnt be found

i actually found it manually but would love to solve this issue next time not the manual way like a mention

the primary address was way different for example

SMTP:TESTUSER@domainname.com
smtp:horsesrun@domainname.com

i ran

Get-Recipient -resultSize unlimited | select name -expand emailAddresses | where {$_.smtpAddress -match "horsesrun@domainname.com"} | Format-Table name, smtpaddress

returned nothing

i then ran get-recipient horsesrun@domainname.com

returned object "horsesrun@domainname.com" couldnt be found
Simon Butler (Sembee)ConsultantCommented:
The second bit

"get-recipient horsesrun@domainname.com"

Wouldn't work, because the command is looking for a name, not an email address.

What you could have done is just

Get-Recipient -resultSize unlimited | select name -expand emailAddresses | Export-Csv -Path:"C:\dir\export.csv"

Then opened it in Excel and searched for the address.
I have just tested the command asking for an address that isn't primary and it found it. Watch the " " when copying from this site, as it can mangle them.

Simon.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Exchange

From novice to tech pro — start learning today.