Skip to content

log on as batch job

Robomikel edited this page Apr 2, 2023 · 4 revisions

Related to these commands but not required
./ssm install-monitor <serverFolder> - Creates Scheduled Task to monitor server
./ssm install-restart <serverFolder> - create scheduled task to restart server daily.
./ssm install-backup <serverFolder> - create scheduled task to backup server daily.

For SSM to perform background tasks. The user created for SSM needs to be added to security group "log on as batch job". The reason for this is, if you are not logged in. As in the computer/server host was rebooted and its still at the lock screen or you logged out. The scheduled task that was created by SSM to monitor or reboot the server needs to be in this group for it to work.

also, its why SSM will ask if you want to setup task to run in background. Makes it so you don't get a terminal window pop up every time monitor runs, or if you wanted to run it like a service in the background to hide the server console window.

Steps:

  1. win + R (should open RUN command window)
  2. type "gpedit.msc" and press enter (should take you to local policy window)
  3. under "Local Computer Policy" click "Windows Settings" -> "Security Settings" -> "Local Policies" -> "User Rights Assignment"
  4. scroll down to and select "log on as batch job"
  5. select "Add User or Group". In the box type username of user that was created for SSM. then, click "check names" to verify.
  6. click OK and Apply