Search code examples
c++windows-serviceswindows-task-scheduler

TaskScheduler is able to execute a service in NT AUTHORITY\SYSTEM account?


I have a Windows service that run in NT AUTHORITY\SYSTEM (SERVICE_WIN32_OWN_PROCESS) account during system startup.

Suppose that I want change the way of automatic execution to Task Scheduler. Task Scheduler will execute my service normally like before and mainly in NT AUTHORITY\SYSTEM account?


Solution

  • TaskScheduler doesn't directly support running services, but you can use a command-line operation to instruct the SCM to start the service (ie, net start "<ServiceName>"). You can use whatever account you want to run the operation, but the account that the service will use is specified in the service's own configuration. The SCM will simply run the service in whatever account has been configured. That will be NT AUTHORITY\SYSTEM by default, if another account is not specified.