determining if a user is in a particular group

B

bj daniels

is there a quick way to determine if a given username is in a particular
groups (w2k3 active directory).

basically I want to say something like this:

while dr.read 'dr is a datareader with a bunch of user records
if IsInGroup(dr("username"), "TeachersGroup") then
blah blah blah
end if
end while


I cannot figure out an easy way to create the IsInGroup function. I know
how to check if the current user is in a group (using the IsInRole
function) - but that doesn't help me in the above example.

thanks

bj daniels
(e-mail address removed)
 
S

Shiva

AFAIK, there is no straight forward method to do it. You have to loop
through the memberOf property of the user's directory entry object.

You might also want to look at this:
http://www.wwwcoder.com/main/parentid/260/site/2208/68/default.aspx

is there a quick way to determine if a given username is in a particular
groups (w2k3 active directory).

basically I want to say something like this:

while dr.read 'dr is a datareader with a bunch of user records
if IsInGroup(dr("username"), "TeachersGroup") then
blah blah blah
end if
end while


I cannot figure out an easy way to create the IsInGroup function. I know
how to check if the current user is in a group (using the IsInRole
function) - but that doesn't help me in the above example.

thanks

bj daniels
(e-mail address removed)
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top