I tried ADSearch and I get no output for some reason.

When I use this:

Code:

Function GetComputerOU()
Redim $TempArray[0]
Redim $GetComputerOU
$adSys = CreateObject("ADSystemInfo")

$TempArray = Split($adSys.ComputerName,",")
; Check if there's a comma in the CN, eg if the user name = "Surname, Name" AD returns "Surname\, Name"

If Right($TempArray[0],1) = "\"
$Start = 2
Else
$Start = 1
EndIf

For $Counter = $Start To UBound($TempArray)
If Len($GetComputerOU) = 0
$GetComputerOu = $TempArray[$Counter]
Else
$GetComputerOu = $GetComputerOu + "," + $TempArray[$Counter]
EndIf
Next

$adSys = 0
EndFunction GetComputerOU()



That I grabbed out of another post here, I get:

Code:

OU=Computers OU,OU=HQ,DC=corp,DC=premcor,DC=tld



The "HQ" is the OU that I am looking for. Unfortunately, I am not 100% with .KIX. I tried everything I could think of to pick that "HQ" out of that but nothing seemed to work.

So if someone could just give me some info on how to get that, as well as do something similar for the User, that would be great.

Thanks!
_________________________
-- oobnuker - .KIX hack - no really.