Page 1 of 1

Issue With Patch Remedy Maintenance Function Script

Posted: Thu Dec 31, 2020 6:13 pm
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...

Re: Issue With Patch Remedy Maintenance Function Script

Posted: Thu Dec 31, 2020 6:52 pm
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.

Re: Issue With Patch Remedy Maintenance Function Script

Posted: Tue Jan 05, 2021 9:11 pm
by Cubert
Let me look into this further.

Re: Issue With Patch Remedy Maintenance Function Script

Posted: Wed Jan 06, 2021 4:40 pm
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)