How to generate and export disabled users report

The following is a comparison between obtaining a disabled users report with Windows PowerShell and ADManager Plus.

Windows PowerShell

Steps to obtain disabled 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
$OutFile = 'C:\Scripts\DisabledUsers.csv' 
# your output file $filter = {Enabled -eq $false} Get-ADUser -Filter $filter
| foreach {Add-Content -path
$OutFile "$($_.SamAccountName),
$($_.distinguishedName)"}
Click to copy entire script

ADManager Plus

To obtain the report,

  • Select Disabled Users from User reports section. 
  • Select domain and OU. Click Generate. 
  • Select Export as and choose from the drop-down list to obtain the report in the preferred format (CSV, PDF, HTML, CSVDE and XLSX).

Screenshot

A screenshot of ADManager Plus with all the disabled users in the domain
 

» Start 30-day Free Trial

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

  • We can run this script only from the computers which has Active Directory Domain Services role.
  • Difficult to export in other formats.
  • Applying filters like OU or name will increase the complexity.

ADManager Plus has incorporated 'Disabled Users' feature in the User Reports for easy access to this report.

Email Download Link