IsInRole does not seem to work

From: RDufour (rdufour_at_sgiims.com)
Date: 09/15/03


Date: Mon, 15 Sep 2003 13:52:51 -0400


The following code

Dim myUser As System.Security.Principal.WindowsIdentity

Dim winPrincipal As New
System.Security.Principal.WindowsPrincipal(System.Security.Principal.Windows
Identity.GetCurrent())

Dim username As String = winPrincipal.Identity.Name

If winPrincipal.IsInRole("Users") Then

'OK

Else

'Not OK

End If

Always returns NOT OK even though while debugging I can see my username
correctly I can go to the local administration on my server that I develop
om (w2k- SP4) see that my username Bob is part of users administrators and
part of Users. No matter what usergroup I write in (checking capitalization
is same) the isinRole function never returns True.

Can anyone tell me what's wrong?

Thanks in advance,

Bob