Hi EE .. I need to pull all users from multiple OUs and I can't figure it out .
Can someone help me modify this so I can enter all the OUs into one script ?
#$OU2 = "OU=Admin,DC=mylab,DC=com"
#This works for one OU but I can't figure out how to have it pull from other OUs.
$OU = "CN=Users,DC=mylab,DC=com"
Get-aduser -Filter * -SearchBase $OU | select SamAccountName