Wednesday, January 18, 2017

Detect and Remove Windows Updates

On occasion there are needs to remove certain updates from a local machine. Here are scripts that I have used to do that.
You can create a simple baseline in SCCM (or other tools) to detect the patch and then uninstall. In this case we are looking to remove KB2553154.

Detection Script:
$GetHotfix = Get-Hotfix | Where-Object {$_.HotFixID -eq 'KB2553154'}
if ($GetHotfix -eq $null) { return $true } else { return $false }

Remediation Script:
wusa /uninstall /kb:2553154 /quiet /norestart

No comments: