Windows – Give users the right to restart a service

permissionsservicewindows

Based on How to give rights to one user for the restart of a service

I've tried the command

sc sdset My.Service (A;;RPWP;;;S-1-1-0)

which i believe should give all users permission to restart My.Service

when I run the command

the error is:

[SC] ConvertStringSecurityDescriptorToSecurityDescriptor FAILED 87:    
wrong parameter

What am I doing wrong?

EDIT:

sc sdset My.Service D:(A;;RPWP;;;S-1-1-0)

sc succeeds, but net.exe and sc.exe gives permission denied

Best Answer

You need to prefix the entires with D: like this:

sc sdset My.Service D:(A;;RPWP;;;S-1-1-0)