Update 12/2015: A Powershell version of this article is here.
There are several ways to do this, but the method I prefer to use is GET-QADUser command from the Quest Active Server Roles PowerShell module, as it will dump the information I want with a minimum of fuss.
- Start the ‘ActiveRoles Management Shell for Active Directory’ console
- Enter the following command string
Get-QADUser -sizelimit 0 | Select-Object sAMAccountName, DisplayName
- and then press Enter
SamAccountName DisplayName
DaggF Fred Dagg
CollinsP Paul Collins
SprouleK Ken Sproule
ReithP Peter Reith
SmithC Coach Smith
RookeM Mike Rooke
Or if I want to dump it out to a CSV file, so I can look at it in Excel:
Get-QADUser -sizelimit 0 | Select-Object sAMAccountName, DisplayName | Export-CSV 'c:\temp\AllDomainUserNames.CSV'
To dump all the user details out, you could doing something like:
Get-QADUser -sizelimit 0 -IncludeAllProperties -SerializeValues | Export-CSV 'c:\temp\AllDomainUserDetails.csv'