I found a script online by Neil Hobson to output the members of all
groups. I'd like to modify that to include only a certain subset, all
of which have similar names. When I tried this, however, I /still/
get all groups, and I'm really new to scripting so I don't know why
and would appreciate any suggestions as to threads on the group to
read, references, URLs, etc.:



Set ADSIResult = ADSICommand.Execute
Do While not ADSIResult.EOF
set ADSIName = (left(ADSIResult.Fields("Name").Value, 25))
set targetname = "XXXXXX xx-xxXXX XXXXXxxXXXxxx"
mycomp = strcomp(ADSIName, targetname, 1)

if mycomp = 0 then
'wscript.echo "matches"
'Left(budgetcode,4)
Output.WriteLine
Output.WriteLine
Output.WriteLine "Group: " & ADSIResult.Fields("name").Value
Output.WriteLine

"==============================================================="
Set GetDN = GetObject("LDAP://" &
ADSIResult.Fields("distinguishedName").Value)
strAllValues = GetDN.GetEx("member")
iGroupCount = 0
For each strValue in strAllValues
If Len(strValue) = 0 Then
Output.WriteLine "There are no members in this group."
Else
iGroupCount = iGroupCount + 1
If objArgs(0)<>"-dn" Then
Output.WriteLine strValue
Else
Call Stripper(strValue)
Output.WriteLine tmp
End If
End If
Next
Output.WriteLine "Total members in group: " & iGroupCount
Set strAllValues = Nothing
ADSIResult.MoveNext