Search code examples
c#securitywindows-serviceslocalsystem

Execute task as system?


I'm trying to test some code that will be running as a service on a remote machine (the service will be running as Local System).

I'm trying to figure out the easiest way on my system to test the code out while it is running underneath the System context.

What would be the easiest way to get the code running underneath the local system account?


Solution

  • You can create a scheduled task and set the user account it runs under.

    Do this via Control Panel\Administrative Tools\Task Scheduler

    Then do Create Task

    In there you can specify the user to run as, e.g. SYSTEM