How to generate and export enabled AD users report

You can generate and export enabled user accounts using native tools such as Windows PowerShell and ADManager Plus. The following is a comparison between obtaining an enabled AD user report with Windows PowerShell and ADManager Plus.

Windows PowerShell

Steps to obtain enabled users report using PowerShell:

  • Identify the domain from which you want to retrieve the report.
  • Identify the LDAP attributes you need to fetch the report.
  • Identify the primary DC to retrieve the report.
  • Compile the script 
  • Execute it in Windows PowerShell.
  • The report will be exported in the given format.
  • To obtain the report in a different format, modify the script accordingly to the needs of the user.

Sample Windows PowerShell script:

 Copied
import-module activedirectory
Get-ADUser-LDAPFilter
"(&(objectCategory=person)
(objectClass=user)
(!userAccountControl:1.2.840.113556.1.4.803:=2))"
-Properties sAMAccountName,
givenName, sn, enabled |
Select sAMAccountName,
givenName, sn, enabled |
Export-Csv -Path
c:\Scripts\Users.csv -NoTypeInformation
Click to copy entire script

ADManager Plus

To obtain the report,

  • Select Enabled Users from the User Reports . 
  • Select Domain and OU. Click Generate. 
  • Select Export as to export the report in any of the preferred formats (CSV, PDF, HTML, CSVDE and XLSX).

Screenshot

A screenshot of ADManager Plus with a report of all enabled users in Active Directory
 

» Start 30-day Free Trial

Following are the limitations to obtain report of enabled user accounts using native tools like Windows PowerShell:

  • We can run this script only from the computers which has Active Directory Domain Services role.
  • Difficulty in exporting the report in other formats.
  • Applying more filters, like OU or 'User name starts with' will increase the LDAP query complexity.

Using PowerShell scripting, each attribute which has to be displayed in the report should be included in the cmdlets in contrast to using the 'Add/Remove Columns' feature of ADManager Plus .'Enabled Users' is a readily available report in ADManager Plus which can be exported in any of the available formats.

Email Download Link