Afficher un message
Vieux 25/09/2007, 22h21   #2
Richard Mueller [MVP]
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Filtering Group membership results

Fred Beck wrote:

> The following script is easy enough:
>
> Set objGroup =
> GetObject("LDAP://CN=GroupName,OU=Denver,DC=Fabricam,DC=com")
> arrMemberOf = objGroup.Getex("member")
> i = 0
> For Each strMember In arrMemberOf
> i = i + 1
> wscript.echo strMember
> Next
> wscript.echo i
>
> It returns each member of the group "GroupName" and then the total number
> of
> members in the group.
>
> Problem is, the limit of Getex appears to be 1000 items and i have more
> than
> that in the group.
> Fortunately, this is a mixed group. It contains Users and Computers. If
> I
> could filter out the computers, I would be under the 1000 item limit. All
> I
> need in the Users in the group anyway.
>
> Problem is I can't figure out the method to filter groups. Can someone
> ?


The only way I know to handle groups with more than 1000 member (1500 in
W2k3) is to use ADO range limits. I have an example VBScript program linked
here:

http://www.rlmueller.net/DocumentLargeGroup.htm

You can only filter container objects, and even if you could filter the
group I suspect the 1000 overall limit would still apply - you would just
see a subset of the 1000. In the program linked above if you don't want the
nested group memberships, comment out the recursive call in the subroutine:

' If the member is class "group",
' call subroutine recursively.
Call _
EnumMembers(objMember.sAMAccountName, _
strOffset & "--")

--
Richard Mueller
Microsoft MVP Scripting and ADSI
Hilltop Lab - http://www.rlmueller.net
--


  Réponse avec citation
 
Page generated in 0,05340 seconds with 9 queries