Connecting Tech Pros Worldwide Forums | Help | Site Map

WinNT: User Group verification in a .vb class?

Victor
Guest
 
Posts: n/a
#1: Jul 21 '05
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

Victor
Guest
 
Posts: n/a
#2: Jul 21 '05

re: WinNT: User Group verification in a .vb class?


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" wrote:
[color=blue]
> 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[/color]
Willy Denoyette [MVP]
Guest
 
Posts: n/a
#3: Jul 21 '05

re: WinNT: User Group verification in a .vb class?



"Victor" <Victor@discussions.microsoft.com> wrote in message
news:0502671A-A236-49D6-84A5-E9156219232A@microsoft.com...[color=blue]
> 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[/color]

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

Willy.


Victor
Guest
 
Posts: n/a
#4: Jul 21 '05

re: WinNT: User Group verification in a .vb class?


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


"Willy Denoyette [MVP]" wrote:
[color=blue]
>
> "Victor" <Victor@discussions.microsoft.com> wrote in message
> news:0502671A-A236-49D6-84A5-E9156219232A@microsoft.com...[color=green]
> > 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[/color]
>
> Please post a repro that illustrates the problem, without that we can't help
> you out.
>
> Willy.
>
>
>[/color]
Mustaq
Guest
 
Posts: n/a
#5: Jul 22 '05

re: WinNT: User Group verification in a .vb class?


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


"Victor" wrote:
[color=blue]
> 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
>
>
> "Willy Denoyette [MVP]" wrote:
>[color=green]
> >
> > "Victor" <Victor@discussions.microsoft.com> wrote in message
> > news:0502671A-A236-49D6-84A5-E9156219232A@microsoft.com...[color=darkred]
> > > 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[/color]
> >
> > Please post a repro that illustrates the problem, without that we can't help
> > you out.
> >
> > Willy.
> >
> >
> >[/color][/color]
Closed Thread


Similar .NET Framework bytes