Is it possible to check if an account has "Logon as service" right programatically. I know how to setup and check this manually but I would like to check it from C# code.
I need to check if this right is enabled on domain level, not just on that particular server.
Edit: I am looking to find out if user "Logon on as a service" is defined at domain group policy level.
There's a group policy API but it's designed for C/C++ use. Even if you can find a way to query a group policy using it, you still won't know if that policy is applied to machines - whether or not group policy is applied can be very complicated, involving forcing, blocking and lookbacks.
It might be better if you told us what you've trying to achieve, to see if there's another approach that might be more fruitful.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With