I have been working on a global login script for my company and everything is going really well thanks to the help I have received here. I have one question though regarding using the InContainer UDF.
The basic premise of my script is as such:
1 Global Script for ALL users.
Using InContainer and TrnaslateName, determine what OU the user is in, and what OU the computer is in.
Based on this information, run a drive mapping script, and a local computer script.
The script works great and I am slowly migrating our "legacy" scripts to this new one. On one particular Domain Controller, I have a significant delay and I can't seem to figure it out. Also note, the DCs are not part of my scope of responsibilities, and the server guys don't seem to care right now - but it is definitely a server issue since it works fine on all the other DCs. Obvisouly, the right choice would be to fix the server/AD, but in the short term, here is my question: I currently have 9 OUs that I am breaking out into different scripts, and by my script, I am basically running InContainer 9 times as such:
Code:
$DCR = InContainer("OU=DCR,DC=corp,DC=premcor,DC=tld","Computer")
$PAR = InContainer("OU=PAR,DC=corp,DC=premcor,DC=tld","Computer")
$LIR = InContainer("OU=LIR,DC=corp,DC=premcor,DC=tld","Computer")
$MER = InContainer("OU=Memphis,DC=corp,DC=premcor,DC=tld","Computer")
$BIR = InContainer("OU=BIR,OU=HQ,DC=corp,DC=premcor,DC=tld","Computer")
$HAT = InContainer("OU=HAT,OU=HQ,DC=corp,DC=premcor,DC=tld","Computer")
$HFR = InContainer("OU=HFR,OU=HQ,DC=corp,DC=premcor,DC=tld","Computer")
$HQ = InContainer("OU=HQ,DC=corp,DC=premcor,DC=tld","Computer")
$CITRIX = InContainer("OU=Metaframe,DC=corp,DC=premcor,DC=tld","Computer")
Also, I am doing this twice ( really like 18 times ) because I have to figure out Computer AND User. While it works and is quite fast most of the time, I can only imagine that 18 queries against AD might be bogging things down. So I wonder if there is a better way to do it - that's where you come in...

Any help would be appreciated. Thanks!