Search and Find Email Addresses in Active Directory

Do you need to get all email addresses from Active Directory?

Do you need to search for a specific email address in Active Directory?

No problem.

In this guide, I’ll show you several examples of how to search Active Directory for email addresses.

Table of contents:

Requirements

Get Email Addresses for All Users Including logon name

In this first example, I will get a list of all email addresses from Active Directory including each users logon name.

Step 1. Open All Users Report

Open the Active Directory Pro Toolkit.

Click on User Reports -> All Users

All Active Directory users report

You should now have the All users report open.

Step 2. Add or remove user fields

Click the columns button and add or remove the user fields you require. In this example, I’m going to include the user’s logon name (sAMAccountName, displayName, status, mail, and proxyAdddresses).

Add or remove user fields

Step 3. Click Run

The last step is to click the run button to generate the report.

List of all email addresses from Active Directory

You can see above, I now have a list of all user accounts, the email address, and the account status (enabled or disabled).

To export the report click the export button and choose the format.

Export users email address

Filter for Active Users Only

If you need to get a list of active users (enabled only) click the filter icon in the status column and select Enabled.

Filter for enabled user accounts

You will now have a list of all enabled users.

In this example, I’ll show you how to search and find an email address in Active Directory. There are times when you have an email address but don’t know which account it belongs to.

1. Run the “All users” report and make sure you have the mail and proxyAddresses attribute added.

2. When the report is completed click the search icon and enter the email address you want to find. You can search on any column so if you don’t know the exact email address you can search by displayname or wild card search.

In this example, I’m looking for the address alber.dull@activedirectorypro.com

Search for an email address in Active Directory

Search for email alias in Active Directory

In this example, I know the email address hr@activedirectory exists but I don’t know which user account it is enabled on.

An email alias is an additional email address added to the proxyAddresses attribute.

Run the all users report and put the alias in the search box.

Find email alist in Active Directory

I can see the alias is enabled for the user Alice Robins and is configured under the proxyAddresses attribute.

Get All Managers and Email Addresses from Active Directory

In this example, I’ll show you how to get a list of all managers and their email address from Active Directory.

Click on All Users -> Users that are a manager

Manager Report in Active Directory

Click columns and include the mail attribute and any other user attribute you require.

Click run to generate the report.

List of managers email address

In the above screenshot, you can see the tool reports three managers.

Find AD Users with No Email Address

In this example, I’ll search for users that have no email address or proxyAddresses configured.

1. Run the All Users Report.

2. In the mail column click the filter icon and select “Blanks”

Filter accounts with a blank email address

The tool will now only list user accounts that have no email address.

List of AD User that have no email address

You can run the same search for users that have no proxyAddresses listed in their accounts.

List of users with no proxyAddress

In the above screenshot, you can see several accounts have no proxyAddresses but do have an email address. You could also create an advanced filter to display accounts that has no email and no proxyAddress.

List of users with no email or proxyAddress

Get AD Users Email Address Using PowerShell

Here are some examples of how to get Active email addresses from Active Directory using PowerShell

Example 1. Get all users email addresses with PowerShell

Get-ADUser -filter * -properties name, EmailAddress, DisplayName | Select Name, EmailAddress, Displayname

This command will get all Active Directory users, the name, email address, and displayname.

Example 2. Find AD User by Email Address

get-aduser -filter {Emailaddress -eq 'robert.allen@activedirectorypro.com'}

This command will find the Active Directory user by a specific email address. In this example, I’m searching for the account that has the email address robert.allen@activedirectorypro.com

Example 3. Get users with no email address using PowerShell

get-aduser -Filter {mail -notlike '*'} -property mail | Select name, mail

This command will get all AD users with no email address.

Example 4. Get Email Address Using login name With PowerShell

$usernames = import-csv -path c:\it\userlist.csv

foreach ($user in $usernames) {

   get-aduser -identity $user.sAMAccountName -Properties mail | select name, mail
}

In this example, I have a list of login names in a CSV and I want to use it to get the email address from Active Directory.

You will need to create a CSV file like this. To identify the accounts you can use one of the following.

  • A distinguished name
  • A GUID (objectGUID)
  • A security identifier (objectSid)
  • A SAM account name (sAMAccountName)

In this example, I’m using the sAMAccountName (logonname).

Save the CSV to your computer and update the PowerShell script path. The script will use the list of accounts from the CSV to search Active Directory for email addresses.

I’ve got some typos in my CSV and that is why the script is unable to find some of the accounts.

That’s it.

If you enjoyed this article check out our list of the most popular Active Directory Tutorials and best practices guides.

Access 200+ Active Directory Reports

with the AD Pro Toolkit

Download Free Trial ->

Leave a Comment