There are many examples of using ADSI in KiXtart. Check out the Scripts forum, COM forum, and the UDF Library for examples.

Download the ADSI documetation from Active Directory Service Interfaces Overview
Here is a little script to get you started.
code:
break on

;
; This script determines the fully qualified distinguished name
; of the current user, then directly binds to active directory
; and queries the name of it's parent container (OU) ...
;
; Requirements: KiXtart 3.63 & Windows 2000 /w Active Directory
;

; Instantiate active directory system info ...

$sysinfo = CreateObject("adsysteminfo")
if vartypename($sysinfo)='object'

; Get user's distinguished name (DN) ...
$username = $sysinfo.username

?"ADsPath = $username"

; Bind directly to user's active directory object ...
$user = GetObject("LDAP://" + $username)

if vartypename($user)='object'

; Get the path of the parent container ...
$parentpath = $user.parent

; Get the parent ...
$parent = GetObject($parentpath)

if vartypename($parent)='object'
$ou = $parent.name

?"OrganizationalUnit = $ou"
else
? "Error creating parent object: @error @serror"
endif
else
? "Error creating user object: @error @serror"
endif
else
? "Error creating adsysteminfo object: @error @serror"
endif
exit



[ 21. October 2002, 20:38: Message edited by: Howard Bullock ]
_________________________
Home page: http://www.kixhelp.com/hb/