Uninstall Windows Update using SCCM

Jonathan LefebvreSCCM, WINDOWS 103 Comments

SCCM Uninstall Windows Update

With the recent problems caused by monthly Windows Update, knowing how to massively uninstall Windows Update with SCCM is a must! This action is not available by default in SCCM.

There are 2 ways to uninstall a Windows Update. Both solutions require the command line utility WUSA.exe, that as been around since Windows Vista/Windows Server 2008 era.

In this post, we will detail both solutions to uninstall a Windows Update with SCCM.

If you are looking for how to manage Windows update with SCCM, see our SCCM Software Update Management Guide for complete instructions.

Prerequisites

  • SCCM any version
  • Windows 7 and up
  • Windows 2008 R2 server and up

SCCM Uninstall Windows Update

One method is to use a Custom Task Sequence with a run command line. The advantage of using this method is the ability to use the same task sequence on both OS Architecture.

Note

On a 64-bits system, since SCCM is a 32 bits application when a WUSA.exe is called, it will attempts to access %windir%\System32 but will be redirected to %windir%SysWOW64

Using a task sequence will work on both OS architectures because we can prevent a Run Command line to redirect file system on x64 clients.

Additional details can be fond on this MSDN article

The second method involves having a script per OS architecture. Nowadays, x64 is pretty much the main OS architecture used on workstation and server. However, there’s still some softwarethat require x86 OS Architecture to run. Using this method will require the right script to run on the right OS architecture. The advantage of this method is to use a simple package/program instead of a Task sequence.

Custom Task Sequence to Uninstall Windows Update

Create a new custom task sequence

  • Under Software Library / Operating System / Task Sequence, right-click and  Create Task Sequence

SCCM Uninstall Windows Update

  • Select Create a new custom task sequence, click Next

SCCM Uninstall Windows Update

  • Name: Uninstall KB, click Next
    • Do not select boot image as we don’t need it

SCCM Uninstall Windows Update

  • Summary, click Next

SCCM Uninstall Windows Update

  • On the Completion screen, click Close

SCCM Uninstall Windows Update

  • Edit the task sequence

SCCM Uninstall Windows Update

  • Click Add, General / Run Command Line

SCCM Uninstall Windows Update

  • Provide the needed information needed. (Change KB number based on the need)
    • Command Line : C:\Windows\System32\wusa.exe /uninstall /kb:4014505 /quiet /norestart
    • Check: Disable 64-bit file system redirection
    • Note that even with the /norestart, the task sequence will trigger a restart. This is because the run command line returns a 3010 error code, which means Restart Required

SCCM Uninstall Windows Update

Deploy custom task sequence

  • Create a Device Collection to target your systems
  • Right-Click your Task Sequence and select Deploy
  • Select your collection, click Next

SCCM Uninstall Windows Update

  • Select Required, click Next

SCCM Uninstall Windows Update

  • Define your Schedule, click Next

SCCM Uninstall Windows Update

  • Select the desired User Experience, click Next
    • Remember that a restart is required. Plan accordingly and use Maintenance Window if needed

SCCM Uninstall Windows Update

  • Set Alert, click Next

SCCM Uninstall Windows Update

  • Leave default option, as there is no download required, click Next

SCCM Uninstall Windows Update

  • Summary, click Next

SCCM Uninstall Windows Update

  • Completion

SCCM Uninstall Windows Update

Once deployed, the Task sequence will uninstall the KB and reboot the computer.

Custom Script to Uninstall Windows Update

A simple batch file can do the trick to remove a Windows Update. As stated earlier, a special consideration must be done for x64 systems.

Create Scripts

For x64 system we will point the script to %Windir%\Sysnative.

x64 script code

cd /d %windir%\sysnative
wusa.exe /uninstall /kb:4014512 /quiet /norestart

For x86 system, we will use %Windir%\System32.

x86 script code

cd /d %windir%\system32
wusa.exe /uninstall /kb:4014512 /quiet /norestart

Save both script under the same folder.

Create SCCM Package

  • Under Software Library / Application Management / Packages, select Create Package

 SCCM Uninstall Windows Update

  • Enter Name, Description and Source Path (where you saved your script)

 SCCM Uninstall Windows Update

  • Select Standard Program, click Next

 SCCM Uninstall Windows Update

  • Enter information
    • Name: Uninstall x64
    • Command line : cmd /c Uninstall-x64.cmd
    • Program can run: Whether or not a user is logged on

SCCM Uninstall Windows Update

  • Limit platform to all X64 OS

SCCM Uninstall Windows Update

  • Under the Uninstall x64 program Properties, change the After running for Configuration Manager restarts computer. Click OK

SCCM Uninstall Windows Update

  • On the package, click Create Program

SCCM Uninstall Windows Update

  • Enter information
    • Name: Uninstall x86
    • Command line : cmd /c Uninstall-x86.cmd
    • Program can run: Whether or not a user is logged on

SCCM Uninstall Windows Update

  • Limit platform to all X86 OS

SCCM Uninstall Windows Update

  • Don’t forget to Distribute Content

SCCM Uninstall Windows Update

Now you have 2 programs that can be deployed on all systems while the OS Architecture limitation will take care of which computer runs which OS architecture!

 

Contributor of System Center Dudes. Based in Montreal, Canada, Senior Microsoft SCCM consultant, working in the industry for more than 10 years. He developed a strong knowledge of SCCM and MDT to build automated OS deployment solution for clients, managed large and complexe environment, including Point of Sale (POS) related projects.
Uninstall Windows Update using SCCM
5 - 1 vote

3 Comments on “Uninstall Windows Update using SCCM”

  1. Hi Jonathan,

    Thanks for the post, but you’re way over-complicating things here. wusa.exe is on the system path, so you can call it directly without having to specify its location.

    In my experience, the best way to remove an update is with an Application. Here are the settings I use.

    Content location: [Leave this blank]
    Installation Program: xyz [Put some random text in here as it’s not allowed to be blank, but we never use it]
    Uninstallation Program: wusa.exe /kb:nnnnnnn /uninstall /quiet /norestart [where nnnnnnn is the KB number]
    Detection Method: PowerShell
    Script Contents: Get-HotFix | Where-Object {$_.HotfixID -eq ‘KBnnnnnnn’}

    Deploy this to your Computer collection with the Action set to Uninstall.

  2. Instead of the name of the kb you set a custom variable and you get a generic ts. You position the variable on your collection and everything becomes agile

Leave a Reply

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