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






I'll take a look at this when I get a chance. Thanks.
_________________________
-- oobnuker - .KIX hack - no really.