Hi,
Take a look at WindowsPrincipal.isinrole
http://msdn.microsoft.com/library/de...nroletopic.asp
Dim wi As System.Security.Principal.WindowsIdentity =
System.Security.Principal.WindowsIdentity.GetCurre nt()
Dim wp As New System.Security.Principal.WindowsPrincipal(wi)
dim r as System.Security.Principal.WindowsBuiltInRole
Trace.WriteLine(String.Format("{0} is in {1} = {2}", wp.Identity.Name,
r.Administrator.ToString, wp.IsInRole(r.Administrator)))
Trace.WriteLine(String.Format("{0} is in {1} = {2}", wp.Identity.Name,
r.BackupOperator.ToString, wp.IsInRole(r.BackupOperator)))
Trace.WriteLine(String.Format("{0} is in {1} = {2}", wp.Identity.Name,
r.PowerUser.ToString, wp.IsInRole(r.PowerUser)))
Trace.WriteLine(String.Format("{0} is in {1} = {2}", wp.Identity.Name,
r.Guest.ToString, wp.IsInRole(r.Guest)))
Ken
------------------------
"Dagoberto Aceves" <da*****@devdex.com> wrote in message
news:O4**************@TK2MSFTNGP09.phx.gbl...
I want to set up different user privileges on the sql server using
groups. At the moment im a little stuck on which way to go with it. I'm
making different forms for each user, depending on their privileges. If
I set up a db with username and passwords, I can check the user against
it and pull their "privilege level" from there.
But i wanted to take advantage of windows authentication so that when
the user contacts sql server, i can pull their group name and assign
forms accordingly. This way, their group name is their privilage level,
and is more managable than i seperate db.
Does anyone know(if possible) how to get the users group name from
vb.net.
Thanks, you guys are really good.
D
*** Sent via Developersdex http://www.developersdex.com ***