know if logged in account is an administrator
C#
1
Posts
1
Posters
0
Views
1
Watching
-
I have .Net 2.0 MSI. I installed this on Vista. To access few functionalities of the application installed, i check if the logged in account is an administrator as below: WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; _IsAuthorized = principal.IsInRole(WindowsBuiltInRole.Administrator) || principal.IsInRole(WindowsBuiltInRole.PowerUser); This function detects the logged in account as administrator only for the user account with which i logged in to install the MSI. For other computer administrator accounts it does not recognize. How do i resolve this issue on Vista? Is there any other way to know if the logged in account is an administrator?