|
|
|
|
||||||
![]() |
|
|
LinkBack | Outils de la discussion |
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
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 ? Thank you! Fred |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
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 -- |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
"Fred Beck" <FredBeck@discussions.microsoft.com> wrote in message news:67BFEBB1-2085-4A67-A5C6-D0AC72DC4CCE@microsoft.com... > Oh wow! I'll have to put my thinking cap on to read that one through. I > think understand the concept. read 1-999, then 1000-1998 until EOF. Far > more > involved script that I expected.. let me digest it for a day.. I may have > a > question or two because I like to understand the script before putting it > to > use. > > Thanks Actually, it's not as complicated as you might think. If the only problem with your script is that it gets only the first 1000 members, the only part that needs to be changed is to specify the ADO range limits; your code does not need to manipulate anything more complicated than the same movenext loop you are already using. /Al |
|
![]() |
| Outils de la discussion | |
|
|