Tip on creating custom templates in Patch Manager

A quick tip on creating custom templates in Patch Manager where you expect to handle many occurrences of the same config.

From the GUI you can create templates around each dynamic rule list and around the server/group selection however even when using these you must still make some manual changes and can not copy these entire configurations. Additionally, if you wish to make a change to one process you have to recreate each and every schedule that uses the same configuration.

In our environment we run 3 passes using slightly different configs applied to a different wsus group each night based on both date and day so often there may actually be 6 tasks to perform. I'd just finished fine-tuning over 100 such schedules, each built manually through the GUI and due to a combination of factors ended up losing them all and had to start again.

Faced with this task I had to find a way to streamline the process and for any future change. I thought I'd share this process in case it helps someone else.

  • Step 1. Create a single schedule for each configuration you require, in my case I created 3. The time schedule itself doesn't matter here, all you want to do is set all your options as you want them.

  • Step 2. Highlight a schedule in the console (admin and reporting->scheduled tasks) and note the ID:

  • Step 3. Open the 'scheduled' folder (default: C:\Program Files (x86)\SolarWinds\Patch Manager\Server\scheduled)

  • Step 4. Create a new subfolder named something like 'templates'

  • Step 5. Locate the folder that matches the name of your schedule ID, open the folder and copy the .xml contained within it to your new 'templates' subfolder. You could rename it to something meaningful so you can keep several template files in the same location but it will need to be renamed back again by script later. 

  • Step 6. Now back in Patch Manager console create all your schedules that need to match your template. This time the configuration is irrelevant, only the schedule time and email info in the last bit is relevant here (nb. you can set a default list of email addresses in the patch manager email config that will apply here).

    Step 7. Create a notepad file and copy/paste every ID on new lines.

  • Step 8. Next we need to overwrite the .xml in every folder matching the ID's with the template .xml. Create a powershell script using get-content against the notepad file along with a foreach and copy command (renaming to task.xml if you changed the name).

  • Step 9. If you ever need to make a change to the config and apply the change to all simply make the change to the template (either manually in notepad or by creating another through the GUI) then re-run the script to apply that change instantly across the board.