Not sure if someone asked the same question in the past.
I have written a simple script to retrieve org users' attribute from LDAP. The search criteria (WHERE clause) is based on "memberOf" attribute. Since my users are allocated into more than 200 groups, I don't think it is a good practise to hardcode all group names into the vbs. (I even tried but I found that the vbs aren't functional if I coded more than 78 groups insides.)
Could anyone tell me if it is possible to make the WHERE clause to read from text file to look for the group names?
My code extract here:
objCommand.CommandText = _
"SELECT cn, displayName, mail, company FROM 'LDAP://ldap.abc.com:389/ou=All Businesses,dc=sales,dc=adc,dc=com'" &_
"WHERE objectClass='person' AND " &_
"memberOf='CN=09758,OU=Groups,DC=SALES,DC=ABC,DC=com' OR"&_
"memberOf='CN=09759,OU=Groups,DC=SALES,DC=ABC,DC=com' "&_
"ORDER BY cn"
Set objRecordSet = objCommand.Execute
objRecordSet.MoveFirst
Regards,
Kelly.
<message edited by kel1014 on Sunday, September 05, 2010 8:41 PM>