Check if the Current User Is an Administrator
public static bool IsCurrentUserAdministrator() { AppDomain.CurrentDomain.SetPrincipalPolicy(PrincipalPolicy.WindowsPrincipal); WindowsPrincipal principal = (WindowsPrincipal)Thread.CurrentPrincipal; return principal.IsInRole(WindowsBuiltInRole.Administrator); }