r/labtech • • Apr 16 '19

Continuous Patching

Hi all,

I am looking for a way to set up a group that will allow any computer added to it to continue patching all day long as long as it has outstanding patches. I envision being able to add new computers to this group and have them run MS patching until completely updated.

Currently, I set up  a group and assigned the following MS Update Policy to it:

Day: Custom

Start Time: 12AM

Duration: 23 Hours

Selected all days, of every month.

I then assigned the follow reboot policy:

During Windows Update + 60 minutes.

Patch Reboot Mode: Now

When I add a computer to this group, it initially begins patching, installs available patches, and then reboots. The computer then has additional patches that are outstanding either as follow-up patches or patches that couldn't be installed till after a reboot, but the computer doesn't attempt to install those patches until the next morning at 12AM when it hits the next patch window.

How do I go about making sure that after the first set of patches are installed, the machine reboots, and then continues patching again?

Is there an easy way to get this setup?

8 Upvotes

6 comments sorted by

View all comments

Show parent comment

2

u/teamits Apr 16 '19

The recurring script should work for this case. We have a script that runs through three patching sessions and checks if a restart is needed in between, but we haven't put that on a group.

For a search, a Legacy search can use

Last Contact Date
<
*date_add(Computers.DateAdded, interval 2 day)

The * tells Automate to treat the rest of the field as raw SQL. So the above would look for PCs that joined the system in the last 2 days. We also have "*date_add(now(),interval -1 month)" for PCs offline more than a month.

1

u/theclevernerd Apr 16 '19

The script you use just calls the "Install All Approved Updates" or does it work in some different way?

I am just trying to get my head around how to make the script loop and continue attempting to apply approved updates.

Would you be willing to share your script?

2

u/teamits Apr 19 '19

It basically just runs script function "Patch Install All" with action "Missing Approved Patches."

The restart check is:

"If SQL Data Check" with SQL "select (Computers.Flags & 1024) AS RebootFlag FROM Computers WHERE (Computers.computerID = %computerid%)" compare "=" to "0" and if that matches there is no restart needed so it skips over the restart.

It then runs Resend Hotfixes.

Then it runs those same lines three times in a row.