Best Practice for Scheduled Jobs and the RunAs field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:46 PM
Hello Community!
Today I have a question about scheduled jobs and the RunAs field.
We have a few scheduled jobs that run to send out reports or make incidents via templates. Unfortunately, those jobs are mostly running as random users (the user who created them). We've already uncovered one instance where that user had been set to inactive and the job stopped running.
My nightmare is as follows: A person in an organization is terminated and we set their account to Inactive and a bunch of scheduled jobs stop running.
Here is the question: Does ServiceNow recommend scheduled jobs run as the system user?
- If so, how would we make sure that the data remains domain separated (for instance, running a report that displays all active incidents at the end of the night but only for one client)?
- If not, would ServiceNow suggest creating a "Service Account" in each domain for scheduled jobs to run as? Do we have to pay a license on a "Service Account" that isn't really logging in but will need all the roles?
- 13,571 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 03:56 PM
We had faced similar issues in the past.
We created service account in sys_user table and ran scheduled jobs with service account.
If you assign role " full-filler, approver ..." to this service account, then you will have to pay license.But, you don't need to assign any role to service account just to run scheduled job.
Regards,
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 04:01 PM
Thanks Sachin,
My issue is that this is going to get expensive for every client we on-board. We're talking about a Service Account for each domain and I'm just not sure if our customers are going to like that (since its an added expense they would normally avoid if they had their own instance).

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 04:07 PM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-05-2017 04:18 PM
I have many jobs running as service account user with no roles.
Also, you can use "System Admin" user to run scheduled jobs
Creating a Scheduled Job - ServiceNow Wiki
Regards,
Sachin