Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Check if AD account has "Logon on as a service" right in Active Directory

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.

like image 777
Anne Avatar asked Oct 01 '09 19:10

Anne


1 Answers

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.

like image 177
serialhobbyist Avatar answered Sep 30 '22 07:09

serialhobbyist