Hi all,
I am trying to get objects from AD. But i would like to get only computers which start as L,D,USD,USL,P.
; Get the domain DN with a server-less ADSI path.
domain = dsGetProperty("LDAP://rootDSE" , "defaultNamingContext") ; DC=microsoft,DC=mill,DC=com
sPath = "LDAP://CN=Computers,":domain ; LDAP://CN=Computers,DC=microsoft,DC=mill,DC=com
lValues = dsGetChldPath(sPath, "") ; ALL Objects from path sPath
i can loop valuse of IValues and extract single object. but how can i say that if computer starts with L OR D OR USD OR USL OR R than continue otherwise keep looping.
The dsFindPath function is your ADSi extender friend
lComputers = dsFindPath(strYourContainerPath, "(&(objectCategory=Computer)(| (cn=l*)(cn=d*)(cn=usd*)(cn=usl*)(cn=r*)))")
Perfect....thanks