Export Azure Active Directory Users Email Address Using PowerShell

In this blog post, I will show you how to export all your Azure Active Directory email addresses using to a CSV file using PowerShell.

Install-Module

To install the Azure PowerShell module, use the following cmdlet.

install-module az

Connect

To connect to Azure AD and Azure run the following cmdlet.

connect-azaccount

Export Emails

The following cmdlet will get all the users you have in Azure Active Directory and export their email address to a CSV file.

You will notice that I am only exporting the email address if you need to export more details simply add the values that you need to the select section.

Get-AzADUser | where {$_.mail} | select mail| export-csv email.csv 

Processing…
Success! You're on the list.

Posted

in

by