Ahhh. Ok, I wasn't reading the formula right. Thx.
So in the end, the whole script looks like this.
Code:
$ou = GetUserOU()
$SS = Split(Split($ou,',DC=')[0],',OU=')[1]
$SS1 = Left($SS,Instr($SS,' ')-1)
$SSLeft = Right($SS,Len($SS)-Instr($SS,' '))
SET "SITE="+$SSLeft
SET "REGION="+$SS1
Function GetUserOU()
Redim $TempArray[0]
Redim $GetUserOU
$adSys = CreateObject("ADSystemInfo")
$TempArray = Split($adSys.UserName,",")
If Right($TempArray[0],1) = "\"
$Start = 2
Else
$Start = 1
EndIf
For $Counter = $Start To UBound($TempArray)
If Len($GetUserOU) = 0
$GetUserOu = $TempArray[$Counter]
Else
$GetUserOu = $GetUserOu + "," + $TempArray[$Counter]
EndIf
Next
$adSys = 0
EndFunction GetUserOU()
Cool, and many thanks. Just made my job as a Citrix Admin a whole lot easier.
hhmm, question about codiquette. Was it ok to remove the remarked out data of the getuserou UDF as supplied, or is it more proper to leave it in?