Get Users AD Account from EMail Address

This script will take a list of email address and return the users AD info, I have enabled View Entire Forest, in case your are in a multi domain environment.

Import-Module ActiveDirectory
Add-PSSnapin Microsoft.Exchange.Management.PowerShell.Admin
$AdminSessionADSettings.ViewEntireForest = $true
Get-Content C:\EmailList.txt | Get-Mailbox | FT SamAccountName,Alias,PrimarySMTP
Facebooktwittergoogle_pluslinkedinby feather

Leave a Reply

Your email address will not be published. Required fields are marked *