Friday, September 28, 2012

PowerShell - get users from OU

$ulist=get-aduser -filter * -SearchBase "ou=?,dc=?,dc=?"
foreach ($user in $ulist)
{
$user.samaccountname
add-content -path c:\temp\?.csv $user.samaccountname
}

No comments:

Post a Comment