Admin rights for a single method
You can add a PrincipalPermission attribute to your method to demand administrative privileges for its execution: [PrincipalPermission(SecurityAction.Demand, Role = @”BUILTIN\Administrators”)] public void MyMethod() { } This is described in more detail in the following article: Security Principles and Local Admin Rights in C# .Net If you are looking for a way to elevate an already … Read more