Uninstall KB update on remote computer in domain using WUSA and PsExec

Step 1 – Check if the KB update is installed

Run the following Powershell script to make sure the KB update actually is installed. It will also show the install date.

Get-Hotfix -computername $hostname | Select HotfixID, InstalledOn | Where-Object { $_.HotfixID -eq $kb } | Sort-Object InstalledOn

Replace $hostname and $kb with the respective hostname and KB number. If you wish, the command can be simplified to:

Get-Hotfix -computername $hostname | Where-Object { $_.HotfixID -eq $kb }

Screenshot Powershell output

Step 2 – Download PsExec

You can download it here: https://docs.microsoft.com/en-us/sysinternals/downloads/psexec

Step 3 – Uninstall KB update

psexec.exe -s \\hostname wusa.exe /uninstall /kb:2952664 /quiet /norestart

Again, remember to change hostname and KB number. If everything went OK it should say wusa.exe exited on $hostname with error code 3010.

Error code 3010 is correct, it means ERROR_SUCCESS_REBOOT_REQUIRED: “The requested operation is successful. Changes will not be effective until the system is rebooted.”

 

Was this post helpful?

2 thoughts on “Uninstall KB update on remote computer in domain using WUSA and PsExec”

  1. They always exit with error code 87. This isn’t working. IF I remove the /quiet flag, it looks like its running, but it just hangs forever. In another terminal window the Get-Hotfix no longer shows its installed on the computer, but there’s no other indication to me if the uninstall completed.

    1. Hi there. It seems Microsoft might have removed the /quiet flag when uninstalling a specific KB. It’s not removed from the wusa.exe utility itself, only when specifying a specific KB. I’m not a sysadmin anymore but apparantly it’s a known problem, see the following threads discussing the same problem:

      https://www.autoitscript.com/forum/topic/184714-silent-uninstall-broken-in-win10-need-suggestions-for-workaround/

      https://social.technet.microsoft.com/Forums/windows/en-US/cdb8140a-aec5-4850-aa82-1ca226aef36a/wusaexe-always-returns-87-with-quotquietquot-switch?forum=win10itprogeneral

Leave a Reply

Your email address will not be published. Required fields are marked *