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

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top