Export User From Active Directory – Powershell And ADUC FREE
Maybe your like
If you are a Windows system administrator and working on Active Directory then you might need to Export User Accounts from Active Directory in cases such as a Exchange and Active Directory migration.
You can also export users manually from the Active Directory. But, it would be very painful tasks, especially in a large organizations who have hundreds of users and accounts.
This is where PowerShell comes to the rescue, once again!
You can export Active Directory users either using the PowerShell or Active Directory GUI interface but with PowerShell, you can export All Active Directory users within a matter of seconds!
In this tutorial, we will show you how to export Active Directory users through two different methods as mentioned above!
Lets jump right into it!
Export AD Users with PowerShell
Before starting, make sure you are logged into an account with sufficient permissions to read from Active Directory.
Exporting users from Active Directory is a very simple task if your unfamiliar with active directory and using it.
In this section, we will show you how to export users from Active Directory with PowerShell.
List Users Attributes
Active directory users have a lot of associated attributes and you should know all available attributes before exporting them.
You can list all available attributes for a specific user using the following command:
get-aduser username -properties *
For example, you can see attributes of a user hitesh by running the following command in your PowerShell terminal:
get-aduser hitesh -properties *
You should see all available attributes in the following screen:

Export All Active Directory Users by Name to CSV
You can export all AD users by name (First, Middle, and Last name) to the CSV file using the Get-ADUser command.
Before exporting users to the CSV, you can list all AD users with the following command:
Get-ADUser -Filter * -Properties * | Select-Object name
You should see all the users in the following output:
name ---- Administrator Guest DefaultAccount krbtgt Hitesh m. jethva vyom h. jethva user1 user2 jayesh rajesh manish mitesh
Now, run the following command to Export all AD users to the CSV file name users.csv.
Get-ADUser -Filter * -Properties * | Select-Object name | export-csv -path c:\users.csv
The above command will export all AD users to the users.csv file located in C: drive.
You can verify whether the users.csv is created or not using the following command:
dir ../../
Example:

Next, go to the C: drive and open the users.csv file as shown below:

Export All Active Directory Users by Name and LastLogonDate to CSV
You can also export all AD users from your domain to the CSV file with the First, Middle, and Last name in the first column and LastLogonDate in the second column.
First, List all AD users by Name and LastLogonDate with the following command:
Get-ADUser -Filter * -Properties * | Select-Object name, LastLogonDate
Next, export the above users with all details to the file user1.csv file as shown below:
Get-ADUser -Filter * -Properties * | Select-Object name, LastLogonDate | export-csv -path c:\user1.csv
Example:

Export All Active Directory Users by Name and Email to CSV
You can also Export all AD Users from your domain to the CSV file with a Name and their Email Address.
First, List all AD users by Name and their Email address with the following command:
get-aduser –filter * -property * | Select-object Name, mail
Next, export the above users with all details in the user1.csv file as shown below:
Get-ADUser -Filter * -Properties * | Select-Object name, mail | export-csv -path c:\user2.csv
Example:

Export ALL Active Directory Users from a specific OU (Organizational Unit)
You can also export all AD users from a specific OU to the CSV file.
For example, lets List all AD users from the Account and Education OU by running the following command:
Get-ADUser -Filter * -SearchBase "OU=Account,DC=WEBSERVERADC,DC=COM" Get-ADUser -Filter * -SearchBase "OU=Education,DC=WEBSERVERADC,DC=COM"
You should see all users of the Account and Education OU in the following screen:

Now, you can export them to the user3.csv and user4.csv file using the following command:
Get-ADUser -Filter * -SearchBase "OU=Account,DC=WEBSERVERADC,DC=COM" | export-csv -path c:\user3.csv Get-ADUser -Filter * -SearchBase "OU=Education,DC=WEBSERVERADC,DC=COM" | export-csv -path c:\user4.csv
Export Users with Active Directory GUI
In this section, we will show you how to export users with Active Directory GUI.
Export All Users from a Specific OU
To export all the users from Education OU follow the below steps:
1. Open Active Directory Users and Computers as shown below.

2. Click on the Education OU and click on the Export button as seen in the top image. You should see the following screen:

3. Provide the path and name of the file you want to save, select save as type to a csv and click on the Save button to export the users.
To Export All the Users from OU follow the below steps:
1. Open Active Directory Users and Computers, click on the Users, click on the Filter button in the top of the screen. you should see the following screen:

2. Select Users and click on the OK button. You should see only users in the Users OU as shown below:

3. Click on the Export button in the top of the screen. You should see the following screen:

4. Provide the path and name of the file you want to save, select save as type to a csv and click on the Save button to export the users.
Now, go to the Documents folder and click on the user4.csv to see all the exported users in the following screen:

Export All Active Directory Users from Domain (From ALL Organizational Unit’s)
With Active Directory GUI, you can export users only from specific OU or folders.
If your organization has lots of OU’s and each OU has lots of users, you will need to export users from each OU one by one.
To resolve this issue and do a Bulk Export of Users, you can Create and use an LDAP query to List all Users from All OU’s, then export them to the CSV file.
You can follow the below steps to export all AD users:
1. Open Active Directory Users and Computers as shown below:

2. Right Click on the Saved Queries and click on the New Query button. You should see the following screen:

3. Provide the name of your query and click on the Define Query button. You should see the following screen:

4. Type your LDAP query in the Advanced tab and click on the OK button. You should see the following screen:

5. Click on the OK button again. You should see all the users in the following screen:

6. Click on the Export button in the top of the screen. You should see the following screen:

7. Provide the path and name of the file you want to save, select save as type to a csv and click on the Save button to export the users.
Now, go to the Documents folder (or wherever you saved your file) and click on the allusers.csv to see all the exported users in the following screen:

Using a Comprehensive AD Tool
An easier option is to use a comprehensive AD management tool, like ManageEngine ADManager Plus, that will provide all the control and visibility you need over your AD and M365 environments. It supports bulk user management using predefined options, templates, and CSV files. With this tool, you can easily manage your AD users, devices, and groups. The best part is that all this management can be done through a single console, which can provide deep visibility into your AD’s operations.
Start a 30-day free trial to get a first-hand view of this tool.
ManageEngine ADManager Plus Start a 30-day FREE Trial
Conclusion
In the above tutorial, we learned how to Export All Active Directory users with PowerShell and Active Directory GUI. We hope you’ve learned how to complete this task from Both PowerShell and Active Directory Users and Computers, as well as using an LDAP query!
The steps above should help you Export all AD Users from the entire Domain or from Specific OU only!
Feel free to ask any questions below in the comments if you have any.
Tag » Active Directory Explorer Export Users
-
Export AD Users To CSV With PowerShell - Active Directory Pro
-
Export AD Users To Csv File - Microsoft Q&A
-
How To Export Users From Active Directory - Admin's Blog - CodeTwo
-
How To Export Active Directory Users To CSV And Build Reports
-
Export List Of All AD User Accounts - Spiceworks Community
-
How To Export Users From Active Directory And Import Them Into Office ...
-
Active Directory User Export Tool - YouTube
-
Exporting Data From An Active Directory Organizational Unit
-
Export Active Directory Data To CSV, Excel, And More - ManageEngine
-
Get The List Of All Active Directory Users Using Powershell
-
How To Export Active Directory Users To CSV - Netwrix
-
Active Directory User Export Tool - CSV Generator - Dameware
-
Exporting Data To Csv From Active Directory - LDAPSoft LDAP Browser
-
Considerations And Limitations - Veeam Backup Explorers Guide