Quote:
Give fnLDAPQuery() a try. Here is an example for the current workstation...
Code:
; == Return the distinguishedName for the computer ===================
$aAttributes = "distinguishedName"
$sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$strFilter = "(&(objectClass=Computer)(Name="+@WKSTA+"))"
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter)
@ERROR " | " @SERROR ?
For Each $Result in $aResults
$Result ?
Next
Chris - the above code works for the DN of the current workstation, but for some reason I can't get the same info for the currently logged in user using this code that I grabbed from another thread:
Code:
; == Return the distinguishedName for the user ===================
$aAttributes = "distinguishedName"
$sADsPath = "LDAP://"+GetObject("LDAP://rootDSE").Get("defaultNamingContext")
$strFilter = "(&(objectClass=User)(Name="+@USERID+"))"
$aResults = fnLDAPQuery($aAttributes,$sADsPath,$strFilter)
@ERROR " | " @SERROR ?
For Each $Result in $aResults
$Result ?
Next
I get a 0 | Operation Completed Successfully, but no information is displayed. Any ideas? I am thinking of just going this route because it appears to work on the users that are having issues, and I would much rather stay within KiX rather than shelling out to VBS in the event things don't work - which is what I am doing now.
_________________________
--
oobnuker - .KIX hack - no really.