PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.win.server.scripting > Filtering Group membership results
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
Filtering Group membership results

Réponse
 
LinkBack Outils de la discussion
Vieux 25/09/2007, 22h30   #1
Fred Beck
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Filtering Group membership results

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
  Réponse avec citation
Vieux 25/09/2007, 23h21   #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
Vieux 02/10/2007, 05h44   #3
Al Dunbar
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: Filtering Group membership results


"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


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 03h40.


Édité par : vBulletin® version 3.7.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,18125 seconds with 11 queries