1. Run the following PowerShell script on your domain controller, specifying the desired name for the output CSV file:
$Path = 'C:\Temp\Users.csv'
Get-ADUser -Filter * -Properties * | Select-Object Name, Enabled, UserPrincipalName | Export-Csv -Path $Path –notypeinformation
If you need to export a users list from a specific organizational unit, add the following parameter to the Get-ADUser cmdlet:
-SearchBase “CN = CommonName, OU = OrganizationalUnit, DC = DomainComponent”
2. Open the file produced by the script in MS Excel.
1. Run Netwrix Auditor → Click “Reports” → Navigate to Active Directory → “Active Directory State-in-Time” → Select “User Accounts” → Click “View”.
2. To export the report to a CVV file, click the "Export" button → Choose “CSV” → Click "Save".