WinNT: User Group verification in a .vb class?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V
 
Actually my code doesnt work. I'm using Forms Authentication to log in using
a windows local user account. The user.isinrole is always false. Please help.
 
Victor said:
Hi all I greatly appreciate your time and help if possible.
I'm currently using User.IsInRole("Group_name") to find out if the logged
in user belongs to a certain NT User Group. For some reason I can do this
only in the .aspx form and not in a class. I would like to write a
function
in a common .vb class that can call the WinNT local users and find out if
current user belongs to a certain group.
Thanks for your help.

V

Please post a repro that illustrates the problem, without that we can't help
you out.

Willy.
 
I figured out what the problem is. I had Anonymous Authentication enabled, so
I couldnt find out what NTGroups the current user belongs.
I'm pulling out user info from ADSI. The code is:

Dim ADGroups, ADGroup As Object
Dim strAdmin as Boolean
Dim ADEntry As New DirectoryEntry("WinNT://DEV2K/administrator")

ADGroups = ADEntry.Invoke("Groups")
For Each ADGroup In ADGroups
If ADGroup.Name = "CMSAdministrator" Then
strAdmin = True
End If
Next
 
Hi Victor,

I need to just capture NT user, Domain and IP from my VB.NET application,
Please let me know, if U have solution.

Regards,
Mustaq
 
Back
Top