Still too much VBS in there.

$sDomainADsPath = "LDAP://" & $oRootDSE.Get("defaultNamingContext")
$ldapPath = $sDomainADsPath
$filter = String.Format("(+(objectCategory=computer)(name="+ @WKSTA +"))")
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.