Search for All the Users in a Specified OU

Sample script that searches Active Directory for all the users in the Finance OU.

 
 
 
 
 
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


  • Variables
    3 Posts | Last post May 23, 2011
    • Hello, I just wanted to ask - where are these variables from "$objDomain, $objItem,$strFilter, $objResult, $colResults"? They are not defined in the code. I didn´t find any of these in Powershell built-in automatic variables. Where to get list and functionality of them?  
    • THIS SCRIPT HAS A SYNTAX ERROR
      
      DOUBLE DOUBLE QUOTES ON THE LDAP PART
    • This script is definitely NOT verfied and tested, as stated on this site!!!
      It simply doesn't work!
      $objOU should be used instead of $objDomain ( which is undefined )
      The double quotes are not Ok as schmeckendeugler wrote.
      If you might want to get all the user objects below the finance dept:
      use: $objSearcher.SearchScope = "Onelevel" ( or "SubTree" )
      
      kind regards, Klaus