-
April 11th, 2012, 10:37 AM
#1
how do I check if an account has logon as a service privileges
I am writing a pre-installation pre-requisite checker utility. I need to test the user account to see if it is local admin and if it has logon-as-a-service privileges. I was able to check for local admin easily using the code listed below. I am finding it very very difficult to check if it has logon-as-a-service privileges. Please help, I am really stuck!
code to check for local admin:
Code:
bool isAdmin;
WindowsIdentity user = WindowsIdentity.GetCurrent();
WindowsPrincipal principal = new WindowsPrincipal(user);
isAdmin = principal.IsInRole(WindowsBuiltInRole.Administrator);
Last edited by mzachen; April 11th, 2012 at 11:18 AM.
-
April 11th, 2012, 10:38 AM
#2
Re: how do I check if an account has logon as a service privileges
-
April 11th, 2012, 11:19 AM
#3
Re: how do I check if an account has logon as a service privileges
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|