Solved

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

Posted on 2013-01-03
4
905 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
  • 2
  • 2
4 Comments
 
LVL 12

Accepted Solution

by:
Gary Dewrell earned 500 total points
Comment Utility
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
Comment Utility
Thank you for the quick response. This is what I needed.
0
 

Author Closing Comment

by:Lorrec
Comment Utility
Thank you for the quick response and information.
0
 
LVL 12

Expert Comment

by:Gary Dewrell
Comment Utility
You are very welcome.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

This script checks a path to see if a folder exists. If the folder does exist you will get output "The folder has previously been created. No action taken" If not it will create the folder. Then adds one user modify permission to the folder. It …
A procedure for exporting installed hotfix details of remote computers using powershell
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 to another domain controller. Log onto the new domain controller with a user account t…
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 …

728 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now