uninstall Windows Updates


Removing via command line

Windows Updates can be removed rather easily via the command line with wusa.exe, the Windows Update Standalone Installer.

Using the wusa.exe command, we can uninstall the update KB1212121 quietly and prompt the user for a restart with the following command:

C:\Windows\System32\wusa.exe /quiet /uninstall /kb:1212121 /promptrestart
1
C:\Windows\System32\wusa.exe /quiet /uninstall /kb:1212121 /promptrestart

Uninstall with wsua command

Uninstall with wsua command

Using PsExec (http://technet.microsoft.com/en-us/sysinternals/bb897553.aspx), we can do the same thing to remote PC’s. In the case of remote PC’s, you may want to include the /warnrestart switch to ensure the user is warned before a reboot happens:

psexec.exe \\computername C:\Windows\System32\wusa.exe /quiet /uninstall /kb:1212121 /warnrestart:600
1
psexec.exe \\computername C:\Windows\System32\wusa.exe /quiet /uninstall /kb:1212121 /warnrestart:600

Uninstalling via Startup/Shutdown script

If you need to remove an update across a larger group of computers that are part of an Active Directory domain, you can uninstall the update as part of a startup or shutdown script.

In the Group Policy Management Console, open the GPO that will contain the script and go to Computer Configuration > Policies > Windows Settings > Scripts (Startup/Shutdown).

Startup-Shutdown scripts

Startup/Shutdown scripts

Click Add and then Browse. This will open the GPO in the Sysvol share for you to create the batch file.

Add Shutdown script

Add Shutdown script

Personally, I like to use Shutdown scripts when I need to remove an update en masse. Typically, updates require a reboot after removal. By using a Shutdown script, the script can run at the next system shutdown/reboot event and the update removal process gets the reboot it needs. By using a Startup script, you may end up needing two reboots to remove the update: one reboot so that the script runs at the next system start and a possible second reboot if the update removal process requires it.

For the script, I use:

C:\Windows\System32\wusa.exe /uninstall /kb:1212121 /quiet /norestart /log
1
C:\Windows\System32\wusa.exe /uninstall /kb:1212121 /quiet /norestart /log

Script to uninstall an update

Script to uninstall an update

By adding the optional, /log, you can go into the Setup Event Log and check that your update was removed.

Event Log- Windows update was successfully uninstalled

Event Log- Windows update was successfully uninstalled

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: