How to get & export all ad users from Active Directory using Powershell

Read on to know how to generate and export a list of all users in Active Directory (AD) using PowerShell and how you can get it done easier with ADManager Plus, a comprehensive Active Directory management solution.

Windows PowerShell

  • Identify the domain for which the all users report is to be generated.
  • Create and compile the script for generating the users report. Execute the script in PowerShell.
  • Sample script to view and export AD users report:
PS C:\> Import-Module ActiveDirectory Get-ADUsers -Filter * -SearchBase "OU=Users,DC=example,DC=com"|Select sAMAccountName,givenName|export-csv -path C:\Scripts\ADUsersRecord.csv
Click to copy entire script

ADManager Plus

  • Navigate to Reports >User Reports > All Users.
  • Select the Domain and the OU(s) for which you wish to generate the user accounts report. You can even export the report as CSV, PDF, XLSX or HTML.


Get the list of all Active Directory Users using ADManager Plus

» Start 30-day Free Trial

Although generating and exporting user reports with native tools like PowerShell looks simple, it comes with a few limitations like:

  • PowerShell script can be run only from the computers which have the Active Directory Domain Services role installed in them.
  • The syntax, parameters and iterations need to be correct. A typo or incorrect syntax might be difficult to spot and rectify especially when the script is a long one.
  • The script needs to be rewritten if the report needs to be generated for a different time limit.

ADManager Plus helps you get the same information from its web based GUI console through pre-defined reports that list all the user accounts. Further, you can also perform management actions such as modification, deletion,etc right from the reports.It also gives you the optionto schedule reports and automatically emailing them to stakeholders. Learn more about it here.

Get critical insights on Active Directory users in your domains with purpose-built reports.

  Get 30-day free trial.
  • Embark on your script-free AD management, reporting, and automation journey with ADManager Plus.
  • By clicking 'Start your free trial now', you agree to processing of personal data according to the Privacy Policy.
  • Thanks
  • Your download should begin automatically in 15 seconds. If not, click here to download manually.

Related Powershell How-to Guides:

The one-stop solution toActive Directory Management and Reporting

Email Download Link