Export User List to CSV File from Active Directory using PowerShell

posted 26 Oct 2016, 04:01 by Tristan Self
Here is a one liner to allow you to do this:

Get-ADUser -SearchBase “OU=Users,OU=Stuff,DC=domain,DC=co,DC=uk” -filter {enabled -eq $true} -properties GivenName,Surname,Department,Company,EmailAddress | select-object GivenName,Surname,Department,Company,EmailAddress | Export-CSV -path 'c:\export.csv'
Comments