Is there a programattic way to query local security policy settings in C#, i.e. the values in secpol.msc?
I would like to read the “Log on as a batch” setting for some user. What should I do ?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
(I can’t really convert this to C# without taking up several pages of code, so I’ll just give a C version.)
You need to:
LsaOpenPolicy.LsaOpenAccount.LsaGetSystemAccessAccount.SECURITY_ACCESS_BATCH_LOGONin the returned value.The definitions are in ntlsa.h, supplied with the Windows DDK (inc/api).
Sample code (untested):