Help with IsInRole

From: Chris (Chris_at_discussions.microsoft.com)
Date: 09/20/04

  • Next message: Jason Wood: "RE: Credentials being lost between servers - out of ideas!"
    Date: Mon, 20 Sep 2004 12:03:04 -0700
    
    

    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


  • Next message: Jason Wood: "RE: Credentials being lost between servers - out of ideas!"