customer relationships

How to Export AD user list with email addresses

If you have the need to export a user list from an Active Directory group along with the user’s email address, run the following command in PowerShell as an administrator.

 

If your AD has the e-mail attribute filed out:

 

Powershell

Get-ADGroupMember -Identity “groupname” -Recursive |
Get-ADUser -Properties Mail |
Select-Object Name,Mail |
Export-CSV -Path C:\file.csv -NoTypeInformation

 

 

Example:

image

 

 

If not you can get it from Exchange too, if thats what you use. 2010:

 

Powershell

Get-DistributionGroupMember -Identity “groupname” |
Select-Object Name,PrimarySMTPAddress |
Export-CSV -Path C:\file.csv -NoTypeInformation

 


Got a project that needs expert IT support?

From Linux and Microsoft Server to VMware, networking, and more, our team at CR Tech is here to help.

Get personalized support today and ensure your systems are running at peak performance or make sure that your project turns out to be a successful one!

CONTACT US NOW
one click social media designs