Help with IsInRole

C

Chris

Hi,
I am using windows integrated authentication aon my intranet. How do I check
if a user is a member of a group in active directory. I have the foll test
code but it's not working



Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button1.Click

If User.IsInRole("USA\Administrators") Then

TextBox2.Text = ("Role: Administrator").ToString

Else

TextBox2.Text = ("Unable to check Role").ToString




End If
End Sub

note: usa is name of my domain


I get the second message "Unable to check Role". The Windows Authentication
works great. If i use


TextBox1.Text = User.Identity.Name

I get the correct logged on user. The only problem here is checking the
role/group in active directory.

Thanks
 

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,776
Messages
2,569,603
Members
45,192
Latest member
KalaReid2

Latest Threads

Top