| 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] |