PowerShell – Get AD Users

Last updated on March 26th, 2018 at 01:47 pm

Import-Module ActiveDirectory
Get-ADUser -Filter * -SearchBase “OU=Sales,OU=Users,OU=Bulgaria,OU=Migu Pro,OU=Office,DC=gooogle,DC=local” -Properties * |
Select -Property Name,Mail,Department | 
Export-CSV "C:\Export\Sales.csv" -NoTypeInformation -Encoding UTF8

Leave a comment

Your email address will not be published. Required fields are marked *