Solved

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

Posted on 2013-01-03
4
1,137 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

IoT Devices - Fast, Cheap or Secure…Pick Two

The IoT market is growing at a rapid pace and manufacturers are under pressure to quickly provide new products. Can you be sure that your devices do what they're supposed to do, while still being secure?

Question has a verified solution.

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

Had a business requirement to store the mobile number in an environmental variable. This is just a quick article on how this was done.
In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
This tutorial will walk an individual through the process of configuring their Windows Server 2012 domain controller to synchronize its time with a trusted, external resource. Use Google, Bing, or other preferred search engine to locate trusted NTP …
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …
Suggested Courses

615 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