If we take Richard's lead and go over to http://msdn.microsoft.com, we see what you need..
Do a search from the home page of -
"active directory" title user properties
and the first result is - Optimization Using GetInfoEx
Take the vb code -
Code:
' Bind to a specific user object.
Set usr = GetObject("LDAP://CN=Jeff Smith,CN=Users,DC=fabrikam,DC=com")
' The code example assumes that the property description has a single value in the directory.
' Be aware that this will implicitly call GetInfo because, at this point, GetInfo
' has not yet been called (implicitly or explicitly) on the usr object.
Debug.Print "User's common name is " + usr.Get("cn")
Debug.Print "User's title is " + usr.Get("title")
Debug.Print "User's department is " + usr.Get("department")
And.. Convert it to KiXtart -
Code:
; Bind to a specific user object.
$usr = GetObject("LDAP://CN=Jeff Smith,CN=Users,DC=fabrikam,DC=com")
;You could replace this with -
;$usr = GetObject("LDAP://CN="+@fullname+",CN=Users,DC=<YOURCOMPANY>,DC=com")
; The code example assumes that the property description has a single value in the directory.
; Be aware that this will implicitly call GetInfo because, at this point, GetInfo
; has not yet been called (implicitly or explicitly) on the usr object.
?"User's common name is "+$usr.Get("cn")
?"User's title is "+$usr.Get("title")
?"User's department is "+$usr.Get("department")
SLEEP 3
HTH,
Kent