Please note! I do not want to find out the user/members of a group but the groups of which a selected group is a member of.
And I have this query which is accepted by the ADS as a valid question:
"SELECT Name,DistinguishedName,description,whenChanged,whenCreated,memberof FROM 'LDAP://" & SDomain &"' WHERE objectCategory = 'group' AND name ='" & group & "'"
However, when I try to read the values stored in string (array?) "memberof", I can't. In many of our cases these are empty or single and sometimes also multiple values. And the script gets an error on the empty ones.
memberof=""
numberOfMemberships=0
memberships=oRS0.Fields("memberof")
For each ADSgroup in memberships
memberof= memberof & ADSgroup & ";"
numberOfMemberships=numberOfMemberships+1
Next
I get "Microsoft VBScript runtime error '800a01c3' Object not a collection"
triggerd by line:
For each ADSgroup in memberships
Do any of you have any idea what I'm doing wrong here?
Yes I've found the answer to my own question. Adding the IsNull chek solved it:
Thanks anyway.