I have modified the script to remove the CN= part of the computer name. We don't want to have the computer name returned as CN="computername", we want to see just computer name.

I have changed the script to delete the "CN=" part of the return.
 Quote:

Dim $objAdsPath, $obj, $filter[0]
$filter[0] = "computer"
$objADsPath = GetObject("LDAP://OU=IT Suite,OU=Computers,OU=whatever,DC=domain,DC=internal")
If @Error = 0
$objAdsPath.filter = $filter
For Each $obj In $objAdsPath
? $obj.name
$PcName = SUBSTR($obj.name, 4)
? $PcName
Next
Else
? "Not able to connect to LDAP path."
Endif


Thanks Rob


Edited by Robdutoit (2012-08-31 10:50 PM)
Edit Reason: copied wrong