Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search for Users in OU and subous

Status
Not open for further replies.

dukkse

Technical User
Oct 15, 2003
42
US
Hey!

I have a script that lists all users in our AD and looks for who has a homedrive on a specific server and then lists it.
The problem is that we have 5 major OU:s and I don't want to search more than one of them. How can I make this work better and quicker since now it takes about 1 hour (yeah, we have a LOT of objects).
Even if you could make it more smoother and just search by user it would be nice.
Here is the script today

strServer = InputBox("What resource server:","Resource Server")
Set oGroup = GetObject("WinNT://myCompany")
strUSers = strDomain & "\" & strGroup & vbNewLine
for each member in oGroup
If Instr(member.Homedirectory,strServer) Then WScript.Echo member.FullName
next


Thanks
Daniel
 
Hello dukkse,

You have to review your script and repost it with less confusion/typos.

regards - tsuji
 

I also list all the users of the AD. With this script you dont have to go through all UO's
On my pc getting all userinformation takes about 30 secs for 1700 users.
For reference i suggest you take a closer look at the AD schema Object.

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top