I just searched a lot in the web but I could not found any help. I have a own windows service and now it should be possible to configure it from my main software.
I have no problems with installing, starting, stopping, changing and uninstalling it. I can also install the service with other user credentials.
But there's the problem. Before installing the service ("cmd" call sc create SERVICENAME [...]) I want to check if the user with the entered credentials can start services or not. So I need to check if he is entered at the local "Log On as a Service" security policy. I do not want to change the policy, I only want to check if he is allowed to do this.
Is it possible to do this check simply in C#?