Server 2012 R2.. AD user list print out.

G Maroun

New Member
Joined
Feb 22, 2024
What is the fastest way to generate a list ( csv or txt) of all emails registered in AD installed on 2012 r2?
 
To generate a list of all email addresses of users in Active Directory (AD) installed on Windows Server 2012 R2, you can use PowerShell. Here's a step-by-step guide on how to do this:

1. Open PowerShell with administrative rights on the Windows Server 2012 R2 machine where the Active Directory is installed.

2. Run the following PowerShell command to import the Active Directory module:
```powershell
Import-Module ActiveDirectory
```

3. Next, you can use the following PowerShell script to generate a CSV file containing a list of all user email addresses in Active Directory:
```powershell
Get-ADUser -Filter * -Properties EmailAddress | Select Name, EmailAddress | Export-Csv -Path "C:\Path\To\Export\List.csv" -NoTypeInformation
```
Replace "C:\Path\To\Export\List.csv" with the path where you want to export the CSV file containing the user email addresses.

4. Run the script, and it will generate a CSV file with two columns: "Name" and "EmailAddress", listing the names and email addresses of all users in Active Directory.

5. You can also modify the PowerShell script to export the list to a text file (TXT) instead of a CSV file. Just replace the Export-Csv cmdlet with Out-File like this:
```powershell
Get-ADUser -Filter * -Properties EmailAddress | Select Name, EmailAddress | Out-File -FilePath "C:\Path\To\Export\List.txt"
```

These steps should help you quickly generate a list of all email addresses registered in Active Directory on a Windows Server 2012 R2 machine. If you encounter any issues or need further assistance, feel free to ask!
 
Back
Top Bottom