0
Answer

ServiceController permission check

Ask a question
dlight

dlight

15y
7.2k
1
Hello All,

In C# I need to check if current user has permission to change status of a (background) service or not. I am accessing the service through ServiceController and trying to use ServiceControllerPermission classes but haven't found any solution.

I know if I try to change status it will return an exception and I will know that I do not have access to change status of a service. But I need a method that without changing status of a service.

ie. I need a way to "query status change (start or stop a service) permission for a given service"

Any help is appreciated.