Get AD Users and Export to CSV
Powershell is not only making doing system administration tasks easy but also very effective and saves lot of time.
Instead of connecting to AD, searching for particular user and copying pasting contents. You can just use one line powershell script to do this for you.
Get-ADUser -Filter ‘*’ | select SamAccountName, Department, Location | Export-Csv c:\temp\ADUsers.csv
Full script here
# Import Active Directory Module
write-Output “Error while importing Active Directly module”
write-Output “please install AD Powershell modules first before running this script.”
# Get AD Users and export results to CSV
$Users = Get–ADUser -Filter ‘*’ | select SamAccountName, Department, Location
$users | Export-Csv c:\temp\ADUsers.csv