Solved

Get the AD User account using e-mail address from a list using PowerShell

Posted on 2013-01-03
4
1,019 Views
Last Modified: 2013-01-03
I have a list of e-mail addresses. I would like to query Active Directory and get the user logon name attached to each e-mail address. I was trying to use Get-ADUser but keep running into problems. Could someone point me in the right direction?
0
Comment
Question by:Lorrec
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Gary Dewrell earned 500 total points
ID: 38741600
Couple of different ways to do this. If you have exchange 2007 or later you can just poll exchange for the info get-mailbox -identity $username

If you need to poll ad for it you will find that the built in AD commandlets or not so good however Quest has released a free set of commandlets to extend AD access from powershell.

Using the Quest commandlet it would be simply:

get-qaduser | where {$_.email -eq "user@domain.com"}

http://www.quest.com/powershell/activeroles-server.aspx
0
 

Author Comment

by:Lorrec
ID: 38741657
Thank you for the quick response. This is what I needed.
0
 

Author Closing Comment

by:Lorrec
ID: 38741659
Thank you for the quick response and information.
0
 
LVL 12

Expert Comment

by:Gary Dewrell
ID: 38741667
You are very welcome.
0

Featured Post

Best Practices: Disaster Recovery Testing

Besides backup, any IT division should have a disaster recovery plan. You will find a few tips below relating to the development of such a plan and to what issues one should pay special attention in the course of backup planning.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

This article outlines the process to identify and resolve account lockout in an Active Directory environment.
This article explains the steps required to use the default Photos screensaver to display branding/corporate images
This tutorial will walk an individual through the process of transferring the five major, necessary Active Directory Roles, commonly referred to as the FSMO roles from a Windows Server 2008 domain controller to a Windows Server 2012 domain controlle…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

761 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question