Amit Jathan
May 15th, 2003, 08:22 AM
I created a New Group Called AppOperators under
Computer Management => Local Users and Groups => Groups
I then added my account into the AppOperator Group, after adding. I refreshed the window using Action => Refresh.
When i run the below code, i am getting the value as False for "Is in AppOperators group". And when i restarted the PC it worked fine (i.e. it returned the value as True)
I have performed this steps several times, but to get the Correct value I have to re-boot the machine.
I have tested the below code on WinXP Professional and Windows 2000 Advance Server with latest SP installed.
I am using VS.NET Version 2002.
Framework Version: 1.0.3705 with SP2 installed.
Am missing something or am i performing any steps incorrectly?
Any information on this would be very helpful.
----------------------------------------------------------
Code:
----------------------------------------------------------
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
Dim user As WindowsPrincipal = CType(System.Threading.Thread.CurrentPrincipal, WindowsPrincipal)
Dim sbDetail As New StringBuilder()
With sbDetail
.AppendFormat("User name: {0}", user.Identity.Name & ControlChars.CrLf)
.AppendFormat("Authentication type: {0}", user.Identity.AuthenticationType & ControlChars.CrLf)
.AppendFormat("Is in AppOperators group: {0}", user.IsInRole("MUJTABA03\AppOperators") & ControlChars.CrLf)
End With
Call MessageBox.Show(sbDetail.ToString, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)
Computer Management => Local Users and Groups => Groups
I then added my account into the AppOperator Group, after adding. I refreshed the window using Action => Refresh.
When i run the below code, i am getting the value as False for "Is in AppOperators group". And when i restarted the PC it worked fine (i.e. it returned the value as True)
I have performed this steps several times, but to get the Correct value I have to re-boot the machine.
I have tested the below code on WinXP Professional and Windows 2000 Advance Server with latest SP installed.
I am using VS.NET Version 2002.
Framework Version: 1.0.3705 with SP2 installed.
Am missing something or am i performing any steps incorrectly?
Any information on this would be very helpful.
----------------------------------------------------------
Code:
----------------------------------------------------------
AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal)
Dim user As WindowsPrincipal = CType(System.Threading.Thread.CurrentPrincipal, WindowsPrincipal)
Dim sbDetail As New StringBuilder()
With sbDetail
.AppendFormat("User name: {0}", user.Identity.Name & ControlChars.CrLf)
.AppendFormat("Authentication type: {0}", user.Identity.AuthenticationType & ControlChars.CrLf)
.AppendFormat("Is in AppOperators group: {0}", user.IsInRole("MUJTABA03\AppOperators") & ControlChars.CrLf)
End With
Call MessageBox.Show(sbDetail.ToString, "", MessageBoxButtons.OK, MessageBoxIcon.Information, MessageBoxDefaultButton.Button1, MessageBoxOptions.ServiceNotification)