Powershell

From Piszczynski
Revision as of 10:58, 20 May 2019 by piszczynski>Aleks

Handy Powershell

Export details of users in a specific OU:


$OUpath = '<place OU path here distinguished name of ou in attribute editor>'

$ExportPath = '<place where to put output>'

Get-ADUser -Filter * -SearchBase $OUpath | Select-object DistinguishedName,Name,UserPrincipalName,sAMAccountName | Export-Csv -NoType $ExportPath