Wednesday, 26 March 2014

PS: Export AD users from selected OU using powershell

How to export users from selected OU and it's subtree using powershell?

Get-ADUser -filter * -SearchScope Subtree -SearchBase "OU=Users,OU=Company,DC=Contoso,DC=com"|select-object givenname,surname,samaccountname |export-csv c:\temp\Company_Users.csv

No comments:

Post a Comment