Issue With Patch Remedy Maintenance Function Script

Support and question forum for Patch Remedy 4 WUA plugin for LabTech. This plugin was retired on 06/01/2022. All new Patch Remedy 5 is now the current plugin. This forum is for retaining the old posts for Patch Remedy 4.
Post Reply
Gerner
Posts: 3
Joined: Thu Apr 18, 2019 4:49 pm
5

Issue With Patch Remedy Maintenance Function Script

Post by Gerner »

I've found an issue with the Variable Set function on line 158 for @CURRENTBUILD@ in the Else section that's causing an incorrect comparison later on in the script for Windows 10 machines.

For example, setting the value of @CURRENTBUILD@ to @BUILDNUMBER@.@UBRNUMBER@ produces:

Code: Select all

18363
 .1256
When the expected output is:

Code: Select all

18363.1256
In this example, the script later on jumps to line 243 ":VERSION1909 - Label" and compares @CURRENTBUILD@ >= 18363.1016. This should then exit the script because 18363.1256 >= 18363.1016. @CURRENTBUILD@ is instead found to be less than 18363.1016. I believe it's only comparing 18363 >= 18363.1016 because of the new-line added in line 158's variable set function.

I've corrected this by changing line 158 to Execute PowerShell with the following script, saving the output to @CURRENTBUILD@:

Code: Select all

$buildnum = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name CurrentBuildNumber).CurrentBuildNumber
$ubrnum = (Get-ItemProperty -Path "HKLM:\SOFTWARE\Microsoft\Windows NT\CurrentVersion" -Name UBR).UBR
Write-Host "$buildnum.$ubrnum"
There are obviously other ways to go about fixing it but I think this needs to be corrected in the next update. It probably won't affect how Windows 10 agents are reporting hotfixes in the Patch Remedy plugin, but it has cut down on a ton of unnecessary & outdated cumulative update downloads/installs.

I'm still trying to figure out if Patch Remedy is actually benefiting my environment since most agents are Windows 10 and I've been unable to get the feature update functionality to work...
Last edited by Gerner on Tue Jan 05, 2021 4:42 pm, edited 1 time in total.

Gerner
Posts: 3
Joined: Thu Apr 18, 2019 4:49 pm
5

Re: Issue With Patch Remedy Maintenance Function Script

Post by Gerner »

I've also noticed the current logic doesn't work for 1803. I have an agent on 17134.1304 which is the Feb 2020 cumulative update . This is being compared to 17134.860, on line 212, which is the Jun 2019 cumulative update.

17134.1304 < 17134.860 is correct if we're talking numbers, but not versions.

User avatar
Cubert
Posts: 2549
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Issue With Patch Remedy Maintenance Function Script

Post by Cubert »

Let me look into this further.

User avatar
Cubert
Posts: 2549
Joined: Tue Dec 29, 2015 7:57 pm
8
Contact:

Re: Issue With Patch Remedy Maintenance Function Script

Post by Cubert »

This has been updated as of Build 1.0.4.47 released today. Auto Updates should happen overnight.

Just a note that we released Patch Remedy 1.0.4.47 today with the following new updates.

Adding support for Windows 10 version 20H2

---1.0.4.47---
Updated December 8, 2020—KB4592438 (OS Builds 19041.685 and 19042.685)
Updated December 8, 2020—KB4592449 (OS Builds 18362.1256 and 18363.1256)
Updated December 8, 2020—KB4592440 (OS Build 17763.1637)
Updated December 8, 2020—KB4592446 (OS Build 17134.1902)
Updated December 8, 2020—KB4593226 (OS Build 14393.4104)
Updated December 8, 2020—KB4592473 (OS Build 15063.2584)
Updated October 13, 2020—KB4580328 (OS Build 16299.2166)

Post Reply

Return to “Patch Remedy for LabTech (Patch Remedy 4) Retired”