Created
April 26, 2016 16:20
-
-
Save micmaher/5b3a6d0f2d6c6e8c0f00e7dc246c17d9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # PowerShell 2.0 Compatible Web Call deployed as an SCCM Package | |
| $h = get-hotfix | where {$_.HotFixID -eq 'KB3050265'} | |
| If ($h){ | |
| # Already Installed | |
| $uri = "http://webserver/winupdate/wuaccept.asp?installed='$env:COMPUTERNAME','Yes'" | |
| (New-Object System.Net.WebClient).DownloadString($uri) | |
| Exit | |
| } | |
| # Windows Update was stopped by GPO due to high CPU usage - now restarting it | |
| Set-Service wuauserv -startuptype automatic | |
| Start-Service wuauserv | |
| # Send status update (WIP means Work in Progress) | |
| $uri = "http://webserver/winupdate/wuaccept.asp?installed='$env:COMPUTERNAME','WIP'" | |
| (New-Object System.Net.WebClient).DownloadString($uri) | |
| Start-Sleep -Milliseconds 2000 | |
| Start-Process -FilePath 'wusa.exe' -ArgumentList "Windows6.1-KB3050265-x86.msu /quiet /forcerestart" -Wait -PassThru | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment