filter was left from failed search, thanks. wasnt able to find TranslateName UDF sample that was mention above.


 Code:
 
	Dim $oRootDSE,  $sDomainADsPath, $ldapPath, $filter, $entry, $searcher, $result, $DirectoryServices, $objParent
	$oRootDSE = GetObject("LDAP://RootDSE")
	$sDomainADsPath = "LDAP://" + $oRootDSE.Get("defaultNamingContext")
	$ldapPath = $sDomainADsPath
	$objParent = GetObject("LDAP://CN=softsol000340d,OU=Software_Solutions_Workstations,OU=DCAS,DC=dcas1,DC=com")
	$objParent.Put("description", "@fullname")
	$objParent.SetInfo





trying to do a record set search but it fails everytime at while not $orecordset.eof

 Code:
	Dim $oRootDSE, $sDomainADsPath, $oCon, $oRecordSet, $oCmd, $sGroup, $sProperties, $aDescription, $aMember, $iCount

$oRootDSE = GetObject("LDAP://RootDSE")
$sDomainADsPath = "LDAP://" & $oRootDSE.Get("defaultNamingContext")
$oCon = CreateObject("ADODB.Connection")
$oRecordSet = CreateObject("ADODB.Recordset")
$oCmd = CreateObject("ADODB.Command")


	;$oRootDSE = Nothing
	$oCon.Provider = "ADsDSOObject"
	$oCon.Open("ADProvider")
	$oCmd.ActiveConnection = $oCon
	$sProperties = "ADsPath,description"
	$sGroup = "*"
	$oCmd.CommandText = "<"+$sDomainADsPath+">;(+(objectClass=computer)(cn="+@WKSTA+"));"+$sProperties+";subtree"
	$oRecordSet = $oCmd.Execute
	;$oRecordSet.MoveFirst
		While Not $oRecordSet.EOF ;fails right here
	$icount = $oRecordSet.Fields("ADsPath").Value
		End While
        Dim $oRootDSE,  $sDomainADsPath, $ldapPath, $filter, $entry, $searcher, $result, $DirectoryServices, $objParent
	  $oRootDSE = GetObject("LDAP://RootDSE")
        $sDomainADsPath = "LDAP://" + $oRootDSE.Get("defaultNamingContext")
        $ldapPath = $sDomainADsPath
        $filter = String.Format("(+(objectCategory=computer)(name="+ @WKSTA +"))")
        $objParent = GetObject("$icount")
        $objParent.Put("description", "@fullname")
        $objParent.SetInfo
	$oRecordSet.Close
	$oCon.Close
	$oRecordSet = Nothing
	$oCon = Nothing



Edited by ack2000 (2007-07-10 07:28 PM)