I hate to do this but I am going to plead n00b here.
I would gladly do what you asked, but I don't know where to begin.
I don't even know what your UDF's do, honestly, but it seems to work for me so I used it.
Perhaps this code would help (to show you exactly how I am using it and what I am looking for)
Thanks!
-jdogg
Code:
 Function LANDESK()
If $Client = "Windows 2000 Workstation" OR $Client = "Windows XP Workstation"
If InGroup("\\@wksta\administrators")=0
Return
EndIf
If Exist ("%SYSTEMDRIVE%\NWSUTIL\ldesk81installed.txt")
Return
EndIf
If Exist ("%SYSTEMDRIVE%\NWSUTIL\NoLanDesk.txt")
$JUNK=RedirectOutput("\\ausress0001\groups\workstation list\ExcludedFromLanDesk.log")
?"@WKSTA,@Userid,$Client,@Time,@Day,@Date,@IPaddress0,ExcludedFromLanDesk"
$JUNK=RedirectOutput("")
Return
EndIf
$rc = InContainer ("OU=Clients,OU=Admin US-RTP,OU=US-RTP,DC=na,DC=agrogroup,DC=net", "Computer")
Select
Case $rc[0]=1
$lblThree.ForeColor = 220,20,60
$lblThree.text="LanDesk will now be installed in the background."
Sleep 5
Run "\\AGRVA2.na.agrogroup.net\ldlogon\wscfg32 /IP /STATUS /SCRIPT /F /IP /NOUI /NOREBOOT /CONFIG=BCS_RTPstacfg.ini"
$JUNK=RedirectOutput("%SYSTEMDRIVE%\NWSUTIL\ldesk81installed.txt")
?"----------------------------------"
?"First install of LanDesk 8.1"
?"@Time,@Day,@Date"
? "(@Userid) is logging onto @WKSTA, running $Client."
$JUNK=RedirectOutput("")
$lblThree.text=""
$lblThree.ForeColor = 0,0,0
Case $rc[0]=2
$lblThree.text="object is a member of a child container lower in the hierarchy."
Case $rc[0]=0
$lblThree.text="object is NOT a member of this container or a child of this container."
Case $rc[0]=-1
$lblThree.text="InContainer() Error - Invalid input for $NameType "
Case $rc[0]=-2
$lblThree.text="TranslateName() Error"
Case 1
$lblThree.text="Unknown return code"
EndSelect
EndIf
EndFunction

FUNCTION INCONTAINER($Container, $NameType)
;ACTION Determines if the current NT4 account name type is a member of a specific container (OU, Computers, etc)
; in Active Directory
;PARAMETERS $Container (Required)
; - String value
; Dinstinghished name of the container to check. This must be the fully qualified DN to
; accurately make a determination.
; $NameType (Required)
; - String value
; "Computer" or "User" are currently the only valid values
;REMARKS This function returns true if the object being checked in the the specified container
; or a child container of that specified.
;
;RETURNS An ARRAY of three values:
; InContainer return code
; 1 = object is a member of the exact container specified.
; 2 = object is a member of the container hierarchy.
; 0 = object is not a member of the container hierarchy.
; -1 = Invalid input for $NameType
; -2 = Error in TranslateName
; TranslateName ErrorCode
; TranslateName ErrorText
;
;DEPENDENCIES OS: Active Directory aware client
; Other Functions: TranslateName()
;
;EXAMPLES $rc = InContainer ("OU=test,OU=9826,OU=NCS,OU=Machines,DC=us,DC=tycoelectronics,DC=com", "Computer")
; select
; case $rc[0]=1 ? "object is a member of the specified container."
; case $rc[0]=2 ? "object is a member of a child container lower in the hierarchy."
; case $rc[0]=0 ? "object is NOT a member of this container or a child of this container."
; case $rc[0]=-1 ? "InContainer() Error - Invalid input for $NameType "
; case $rc[0]=-2 ? "TranslateName() Error"
; case 1 ? "Unknown return code"
; endselect
;
;
Dim $CurrentContainer, $Name1, $Name2, $Found, $commaloc
Select
Case $NameType = "Computer" $Name1 = @Domain + "\" + @wksta + "$$"
Case $NameType = "User" $Name1 = @LDomain + "\" + @UserID
Case 1 $Name1 = ""
EndSelect
If $Name1 <> ""
$Name2 = TranslateName (3, "", 3, $Name1, 1)
If $Name2[1] = 0
$Found=0
While $Found=0
$commaloc = instr($Name2[0], ",")
If $commaloc > 1
If substr($Name2[0],$commaloc-1,1) = "\"
$Name2[0] = substr($Name2[0], $commaloc+1)
Else
$Found=1
$CurrentContainer = substr($Name2[0], $commaloc+1)
EndIf
Else
$Found=1
Endif
Loop
Select
Case $CurrentContainer=$Container $InContainer = 1, $Name2[1], $Name2[2]
Case instr($Name2[0], $Container) $InContainer = 2, $Name2[1], $Name2[2]
Case 1 $InContainer = 0, $Name2[1], $Name2[2]
EndSelect
Else
$InContainer = -2, $Name2[1], $Name2[2]
EndIf
Else
$InContainer = -1, 0, ""
Endif
EndFunction

Function TranslateName ($InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType)
Dim $InitType, $BindName, $LookupNameType, $LookupName, $ReturnNameType
Dim $NameTranslate, $ReturnName, $Error, $ErrorText
$Error = 0
$ErrorText = ""
$ReturnName = ""
$NameTranslate = CREATEOBJECT ("NameTranslate")
$Error = @error
$ErrorText = @serror
If $Error = 0
$NameTranslate.Init ($InitType, $BindName)
$Error = @error
$ErrorText = @serror
If $Error = 0
$NameTranslate.Set ($LookupNameType, $LookupName)
$Error = @error
$ErrorText = @serror
If $Error = 0
$ReturnName = $NameTranslate.Get($ReturnNameType)
$Error = @error
$ErrorText = @serror
Endif
Endif
EndIf
$TranslateName = $ReturnName, $Error, $ErrorText
Endfunction