How come the .Filter assignement does not always work? When I try to do a listing of all my groups in a container, and then to list out all of the user accounts in the group, it also lists groups that might be a member of the group.
Anyone know why that is?
here's a snippet
why does its still list some groups? (shown in the
line.
Anyone know why that is?
here's a snippet
Code:
On Error Resume Next
Set oContainer = GetObject("LDAP://ou=groups, dc=yourdomain,dc=com")
For Each object In oContainer
Set oClass = GetObject(object.Schema)
If (oClass.Container) Then
Set objGroup = GetObject(object.ADsPath)
objGroup.Filter = Array("group")
For each objMember in objGroup.Members
If objMember.class = "user" Then
groupname = split(object.Name, " ")
Wscript.Echo JobList(Mid(groupname(0),4))& ", " & Mid(groupname(0),4) & ", ," & objMember.sAMAccountName & ","
Else
WSCript.Echo objMember.class & "--" & objMember.Name
End If
Next
End If
Next
why does its still list some groups? (shown in the
Code:
WSCript.Echo objMember.class & "--" & objMember.Name
line.