Search for All the Users in a Specified OU and Any Sub OUs

Sample scripot that searches Active Directory for all the users in the Finance OU and any child Ous..

 
 
 
 
 
1 Star
(1)
Add to favorites
Active Directory
8/10/2009
E-mail Twitter del.icio.us Digg Facebook
Sign in to ask a question


  • BUG
    1 Posts | Last post June 30, 2010
    • 
      $objOU was defined, but $objDomain was used: 
      
      $objOU = New-Object System.DirectoryServices.DirectoryEntry("LDAP://OU=accounting,DC=domain,DC=local")
      
      $objSearcher = New-Object System.DirectoryServices.DirectorySearcher
      $objSearcher.SearchRoot = $objDomain
      
      Need replace $objDomain with $objOU to get correct result.