Windows groups

zeocrash

Newcomer
Joined
Sep 15, 2004
Messages
8
Hi there
i'm trying to build a page for my company's intranet. The general idea of the page is that we replace the logon page to the intranet options with a page that reads your windows logon details.
Anyway we have Many different parts to the options page and we only want certain users to be able to access certain parts. To do this we want to create a seperate user group for each button in the options menu, and only make the user a member of the groups we want them to be able to access.
At the moment i cannot work how to get user groups for a username. I can get the username fine, but getting what windows groups it is a member of i cannot work out how to do.
How does the data come out of this statement, does it come out as a string that needs to somehow divided to get the individual groups, or do you feed in group names and the statement tells you whether the user is a member.
 
You can use the .NET role-based security related classes to see if the
current logged in user is in the administrators role.

Try this code:
'Place the following Imports statements at the top of the module:
Imports System.AppDomain
Imports System.Threading
Imports System.Security

Dim fIsAdministrator As Boolean
Dim wp As Principal.WindowsPrincipal


CurrentDomain.SetPrincipalPolicy(Principal.PrincipalPolicy.WindowsPrincipal)
wp = CType(Thread.CurrentPrincipal, Principal.WindowsPrincipal)
fIsAdministrator = wp.IsInRole("BUILTIN\administrators")
MsgBox(fIsAdministrator)

See
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/htm
l/cpconcreatingwindowsidentitywindowsprincipalobjects.asp (and related
surrounding "Securing Applications" topics) for more information.
 
zeocrash said:
Hi there
i'm trying to build a page for my company's intranet. The general idea of the page is that we replace the logon page to the intranet options with a page that reads your windows logon details.
[...] I can get the username fine, [...]
QUOTE]

Hi,
I have this problem, too. I don't know how retrive windows logon details. Can you help me?

Christian
 
Back
Top