Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Security > Number of Users in a role

Reply
Thread Tools

Number of Users in a role

 
 
Cathie
Guest
Posts: n/a
 
      03-30-2005
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


 
Reply With Quote
 
 
 
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      03-31-2005
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
>



 
Reply With Quote
 
 
 
 
Cathie
Guest
Posts: n/a
 
      03-31-2005
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
>>

>
>



 
Reply With Quote
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      03-31-2005
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
>>>

>>
>>

>
>



 
Reply With Quote
 
Cathie
Guest
Posts: n/a
 
      04-04-2005
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
>>>>
>>>
>>>

>>
>>

>
>



 
Reply With Quote
 
Joe Kaplan \(MVP - ADSI\)
Guest
Posts: n/a
 
      04-04-2005
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.
>>



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Get Number of Users in Membership Role Jonathan Wood ASP .Net 15 12-04-2007 05:46 PM
AzMan Role Based Security vs. ASP.NET Role Based Security Kursat ASP .Net Security 1 05-07-2007 01:33 PM
Deny acces to users that are not in any role Markus Palme ASP .Net 2 09-22-2006 02:37 PM
Role-Based Security: ACLs and Role Hierarchies Liet Kynes ASP .Net 0 11-26-2003 08:08 AM
Role-based security: Access the role of current user Jesper Stocholm ASP .Net 2 08-23-2003 06:59 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57