Kaseya Community

Script/Agent Procedure to remove specific Windows Patch/KB

  • Hello guys,

    I need a script to remove the latest failed Windows patch that causes BSOD when printing. I've already looked in Community Exchange but the agent procedure seems not working: Uninstall Windows Update | Kaseya Automation Exchange. It runs fine but the failed KB is not removed.

    Have you got any suggestion or a tested working procedure to remove updates via script in Windows 10?

    Thanks.

  • We've been trying this as well, and it fails no matter what we try ... we do know that the /quiet switch is no longer supported in Windows 10 from the command line for WUSA.exe so trying to run wusa /uninstall /kb:xxxxxx /quiet just fails right away ... and when we try to run it without the /quiet switch since it runs in a hidden command prompt no one can press the button to make it go thru the uninstall and as such after 2 hours it fails ....

  • Remember with the new combined LCU and SSU you can no longer use WUSA to remove the update as once installed you can't remove the SSU.  From the KB on the latest 20H2 update: support.microsoft.com/.../march-9-2021-kb5000802-os-builds-19041-867-and-19042-867-63552d64-fe44-4132-8813-ef56d3626e14

    "If you want to remove the LCU

    To remove the LCU after installing the combined SSU and LCU package, use the DISM/Remove-Package command line option with the LCU package name as the argument. You can find the package name by using this command: DISM /online /get-packages.

    Running Windows Update Standalone Installer (wusa.exe) with the /uninstall switch on the combined package will not work because the combined package contains the SSU. You cannot remove the SSU from the system after installation."

    You can find the package information by using: dism /online /get-packages /format:table

    Then just look at the installation dates and name to determine the package you're looking for.

    For the updates from March 9:

    20XX: Dism /online /Remove-Package /PackageName:Package_for_RollupFix~31bf3856ad364e35~amd64~~19041.867.1.8 /norestart /quiet

    1909: Dism /online /Remove-Package /PackageName:Package_for_RollupFix~31bf3856ad364e35~amd64~~18362.1440.1.7 /norestart /quiet

    You should be able to run these commands in an AP or put them in a .cmd file and execute that file in an AP on the system.  That's been working for us.

    And don't forget to reboot.

    Hope that helps.

  • As an update - Microsoft has released the fix as an optional update ... KB5001567 - Windows Update will pick this up and it can be selected to install ... Software Management can be configured to install automatically as well, and so can Patch Management. Or you can write a script to install the KB as well.

    ***UPDATE*** While the update helps most PCs from BSoD'ing - those with Dymo Labelers are still printing blank labels with this new "fix" ...



    Adding Update
    [edited by: Tom Fehlberg at 12:41 PM (GMT -7) on Mar 16, 2021]