How to schedule a maintenance task

jmbrake
Kilo Expert

I have been asked to set up quarterly tasks for Windows Updates.   First we have created a new table called u_planned_maintenance_tasks (which is an extension of the task table).   We have specific fields we will want filled in:   Short Description (Quarterly WSUS Updates); Planned Start Date (10/16/14); Planned End Date (11/1/14); State(Open).   We need to run a schedule job against 3 CI tables:   cmdb_ci_win_server; cmdb_ci_linux_server; and cmdb_ci_esx_server.   I think this can be done via a Schedule Script; but I don't know the java code to do it.

 

For the Run this script section,   I am thinking on these lines: (I need to add in the other fields)

 

var createTsk = new GlideRecord('u_planned_maintenance_task');

createTsk.initialize();

createTsk.short_description = 'WSUS Quarterly Patches October';

createTsk.insert();

 

How do I use the condition area to apply this script against just those 3 types of CI's

4 REPLIES 4

Victor Ruiz
Tera Guru

Hi Joan.....were you able to create this scheduled task?   I am currently trying to get the same procedure started for my team.


The easiest out the box solution is to create a template for the record(s) you want to create and then schedule it.   More details can be found here:


http://wiki.servicenow.com/index.php?title=Creating_a_Template#Creating_Records_with_a_Scheduled_Tem...


Hi Michael....I appreciate the feedback, my dilemma is that my server team is using excel spreadsheets to track all server scheduled patching.   What I would like to provide is a list of the servers that are due for patching, a task for the admin and a schedule.   Would the templates accomplish this for this team?  


Templates are good for the same reoccuring task.   If the list of servers changes on regular basis then unfortunately it will be difficult to utilize templates.