Monday 15 October 2012

Changing Permissions for Task Scheduler and Other Services

At work I wanted to restart the Task Scheduler service on a server, but found that I did not have the permission to do so.  As seen in the screenshot below, the buttons Start, Stop, etc. are all greyed out:


After some Google searches, I found a good thread discussing this problem on SuperUser: http://superuser.com/questions/315705/how-to-assign-permissions-to-manage-windows-service-when-uac-is-enabled.  The answer gave a brief but good explanation of the situation as well as a couple of ways to resolve it.

I vaguely remember coming across this problem before. So I thought I should blog it this time for future references.  Below are the steps to fix this problem.

Firstly we need to find the particular process running the Task Scheduler service.  This service, like several other services, is run inside of one of the svchost.exe processes.  Open a Command Prompt as Administrator, then enter the command:

     tasklist /svc /fi "services eq schedule"

The screenshot below shows the process svchost.exe with PID of 828 is running Task Scheduler:


Next, run Process Explorer from Sysinternals.  As you hover the mouse over the process with PID 828, we can confirm that Task Scheduler is indeed running inside this process:


Next, right click on this process and select Properties.  Then go to Services tab:


Highlight Schedule in the list of services then click the Permissions button.  Here you can see, even users in the Administrators group only have Read access:


This is easily remedied by changing the permission to Full Control:


Finally click the OK button to apply the changes.  Next, let's go back to Task Scheduler in Windows services.  Now we can control the service to our heart's content:


And of course we can use the same method to modify other Windows services.