Hi,
Regarding : Role based Security
Scenario :
On W2K, I'm currently logged in as 'user1'
Checking the properties of the user account 'user1' :
--> Start/Programs/Administrative Tools/Computer Management
In the 'Computer Management' app : opening System
Tools/Local users and Groups/Users
Tab: Member of
'Adminstrators'
Now, I have a test application (VB.NET) where I want to check what group the
currenty logged in user belongs to :
Private myWindowsPrinci pal As WindowsPrincipa l
Dim b As Boolean
myWindowsPrinci pal = New
WindowsPrincipa l(WindowsIdenti ty.GetCurrent() )
b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.Administrator )
===> b is TRUE : OK
b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.User)
===> b is TRUE ????
(b is always TRUE regardless of whether the current User actually
belongs to the 'Users' group or not)
I tried another syntax :
b = myWindowsPrinci pal.IsInRole("M YPC\Users") ' MYPC is
the computer name
===> b is always FALSE ???? regardless of whether the current
User actually belongs to the 'Users' group or not
I tried yet another syntax :
b = myWindowsPrinci pal.IsInRole("B UILTIN\Users")
===> b is always TRUE ???? regardless of whether the current
User actually belongs to the 'Users' group or not
Any ideas ?
Thanks
Regarding : Role based Security
Scenario :
On W2K, I'm currently logged in as 'user1'
Checking the properties of the user account 'user1' :
--> Start/Programs/Administrative Tools/Computer Management
In the 'Computer Management' app : opening System
Tools/Local users and Groups/Users
Tab: Member of
'Adminstrators'
Now, I have a test application (VB.NET) where I want to check what group the
currenty logged in user belongs to :
Private myWindowsPrinci pal As WindowsPrincipa l
Dim b As Boolean
myWindowsPrinci pal = New
WindowsPrincipa l(WindowsIdenti ty.GetCurrent() )
b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.Administrator )
===> b is TRUE : OK
b = myWindowsPrinci pal.IsInRole(Wi ndowsBuiltInRol e.User)
===> b is TRUE ????
(b is always TRUE regardless of whether the current User actually
belongs to the 'Users' group or not)
I tried another syntax :
b = myWindowsPrinci pal.IsInRole("M YPC\Users") ' MYPC is
the computer name
===> b is always FALSE ???? regardless of whether the current
User actually belongs to the 'Users' group or not
I tried yet another syntax :
b = myWindowsPrinci pal.IsInRole("B UILTIN\Users")
===> b is always TRUE ???? regardless of whether the current
User actually belongs to the 'Users' group or not
Any ideas ?
Thanks