Number of Users in a role

Discussion in 'ASP .Net Security' started by Cathie, Mar 30, 2005.

  1. Cathie

    Cathie Guest

    Hi,

    I am trying to work out how I can find the number of users in a role. So
    that I can lock the application after a certain number of users are added to
    that role.

    Does any one know of decent reference material in dealing with windows users
    and roles?

    Cathie
     
    Cathie, Mar 30, 2005
    #1
    1. Advertising

  2. Are you talking about a role as in a Windows group a role you created in
    your own code. .NET has a very flexible system that supports both.

    In general, there are no .NET APIs that support this directly, but you might
    be able to do something based on the specific implementation of the role.

    Joe K.

    "Cathie" <> wrote in message
    news:...
    > Hi,
    >
    > I am trying to work out how I can find the number of users in a role. So
    > that I can lock the application after a certain number of users are added
    > to that role.
    >
    > Does any one know of decent reference material in dealing with windows
    > users and roles?
    >
    > Cathie
    >
     
    Joe Kaplan \(MVP - ADSI\), Mar 31, 2005
    #2
    1. Advertising

  3. Cathie

    Cathie Guest

    I am looking for the number of users in a specific Windows group. I think I
    know how to do it now, it just means that I will have to recursively search
    the AD tree using DirectorySearch to and count the result.

    Cathie

    "Joe Kaplan (MVP - ADSI)" <> wrote
    in message news:...
    > Are you talking about a role as in a Windows group a role you created in
    > your own code. .NET has a very flexible system that supports both.
    >
    > In general, there are no .NET APIs that support this directly, but you
    > might be able to do something based on the specific implementation of the
    > role.
    >
    > Joe K.
    >
    > "Cathie" <> wrote in message
    > news:...
    >> Hi,
    >>
    >> I am trying to work out how I can find the number of users in a role. So
    >> that I can lock the application after a certain number of users are added
    >> to that role.
    >>
    >> Does any one know of decent reference material in dealing with windows
    >> users and roles?
    >>
    >> Cathie
    >>

    >
    >
     
    Cathie, Apr 1, 2005
    #3
  4. It is actually pretty hard to do this in general, but that is the basic
    idea. You need to enumerate the members and then enumerate the members of
    those groups that are also groups. If any of the groups have large numbers
    of members (greater than maxRangeValue for your domain, typically 1000 for
    win2k and 1500 for 2k3), then you'll also need some range retrieval.

    Also, if any of those groups is the primary group, the membership isn't
    included in the member attribute, so you need a different approach
    altogether.

    Why do you need to do this anyway?

    Joe K.

    "Cathie" <> wrote in message
    news:...
    >I am looking for the number of users in a specific Windows group. I think
    >I know how to do it now, it just means that I will have to recursively
    >search the AD tree using DirectorySearch to and count the result.
    >
    > Cathie
    >
    > "Joe Kaplan (MVP - ADSI)" <> wrote
    > in message news:...
    >> Are you talking about a role as in a Windows group a role you created in
    >> your own code. .NET has a very flexible system that supports both.
    >>
    >> In general, there are no .NET APIs that support this directly, but you
    >> might be able to do something based on the specific implementation of the
    >> role.
    >>
    >> Joe K.
    >>
    >> "Cathie" <> wrote in message
    >> news:...
    >>> Hi,
    >>>
    >>> I am trying to work out how I can find the number of users in a role.
    >>> So that I can lock the application after a certain number of users are
    >>> added to that role.
    >>>
    >>> Does any one know of decent reference material in dealing with windows
    >>> users and roles?
    >>>
    >>> Cathie
    >>>

    >>
    >>

    >
    >
     
    Joe Kaplan \(MVP - ADSI\), Apr 1, 2005
    #4
  5. Cathie

    Cathie Guest

    Named user check - for licensing issues :)

    "Joe Kaplan (MVP - ADSI)" <> wrote
    in message news:OV%...
    > It is actually pretty hard to do this in general, but that is the basic
    > idea. You need to enumerate the members and then enumerate the members of
    > those groups that are also groups. If any of the groups have large
    > numbers of members (greater than maxRangeValue for your domain, typically
    > 1000 for win2k and 1500 for 2k3), then you'll also need some range
    > retrieval.
    >
    > Also, if any of those groups is the primary group, the membership isn't
    > included in the member attribute, so you need a different approach
    > altogether.
    >
    > Why do you need to do this anyway?
    >
    > Joe K.
    >
    > "Cathie" <> wrote in message
    > news:...
    >>I am looking for the number of users in a specific Windows group. I think
    >>I know how to do it now, it just means that I will have to recursively
    >>search the AD tree using DirectorySearch to and count the result.
    >>
    >> Cathie
    >>
    >> "Joe Kaplan (MVP - ADSI)" <>
    >> wrote in message news:...
    >>> Are you talking about a role as in a Windows group a role you created in
    >>> your own code. .NET has a very flexible system that supports both.
    >>>
    >>> In general, there are no .NET APIs that support this directly, but you
    >>> might be able to do something based on the specific implementation of
    >>> the role.
    >>>
    >>> Joe K.
    >>>
    >>> "Cathie" <> wrote in message
    >>> news:...
    >>>> Hi,
    >>>>
    >>>> I am trying to work out how I can find the number of users in a role.
    >>>> So that I can lock the application after a certain number of users are
    >>>> added to that role.
    >>>>
    >>>> Does any one know of decent reference material in dealing with windows
    >>>> users and roles?
    >>>>
    >>>> Cathie
    >>>>
    >>>
    >>>

    >>
    >>

    >
    >
     
    Cathie, Apr 4, 2005
    #5
  6. Gotcha. Good luck then! Make sure you test with large group memberships, a
    mix of security and non-security groups and nested groups from other
    domains. There are a variety of ways that this thing can get very
    complicated and blow and give you trouble.

    Joe K.

    "Cathie" <> wrote in message
    news:...
    > Named user check - for licensing issues :)
    >
    > "Joe Kaplan (MVP - ADSI)" <> wrote
    > in message news:OV%...
    >> It is actually pretty hard to do this in general, but that is the basic
    >> idea. You need to enumerate the members and then enumerate the members
    >> of those groups that are also groups. If any of the groups have large
    >> numbers of members (greater than maxRangeValue for your domain, typically
    >> 1000 for win2k and 1500 for 2k3), then you'll also need some range
    >> retrieval.
    >>
    >> Also, if any of those groups is the primary group, the membership isn't
    >> included in the member attribute, so you need a different approach
    >> altogether.
    >>
    >> Why do you need to do this anyway?
    >>
    >> Joe K.
    >>
     
    Joe Kaplan \(MVP - ADSI\), Apr 4, 2005
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jesper Stocholm
    Replies:
    2
    Views:
    8,117
    John Saunders
    Aug 23, 2003
  2. Liet Kynes
    Replies:
    0
    Views:
    495
    Liet Kynes
    Nov 26, 2003
  3. Markus Palme
    Replies:
    2
    Views:
    4,218
    Markus Palme
    Sep 22, 2006
  4. Jonathan Wood

    How to Get Number of Users in Membership Role

    Jonathan Wood, Nov 28, 2007, in forum: ASP .Net
    Replies:
    15
    Views:
    719
    Jonathan Wood
    Dec 4, 2007
  5. Kursat
    Replies:
    1
    Views:
    320
    Dominick Baier
    May 7, 2007
Loading...

Share This Page