IsInRole does not seem to work

From: RDufour (
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

Dim username As String = winPrincipal.Identity.Name

If winPrincipal.IsInRole("Users") Then



'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,