Posted On April 17, 2019

Manually Dealing with Windows Updates

kimconnect 0 comments
blog.KimConnect.com >> Windows >> Manually Dealing with Windows Updates

This unabridged note contains some usable copy/paste lines to work with Windows updates. There’s a comprehensive Windows Golden Image setup that simplifies the process of generating a pristine template, which is outside the scope of this chicken-scratch blob…

Check if proxy is enabled in the current Windows Server:

PS C:\WINDOWS> (Get-ItemProperty -Path "Registry::HKCU\Software\Microsoft\Windows\CurrentVersion\Internet Settings").ProxyEnable
1

If proxy is enabled (result=1), then set winhttp to use the desired proxy

# Set winhttp proxy with exclusion list
$proxy="http://proxy:8080";
$exclusionList="localhost;*.kimconnect.com"
netsh winhttp set proxy $proxy $exclusionList

# Allow System to use Default Credentials to authenticate to proxy
[system.net.webrequest]::defaultwebproxy = New-Object system.net.webproxy($proxy)
[system.net.webrequest]::defaultwebproxy.credentials = [System.Net.CredentialCache]::DefaultNetworkCredentials
[system.net.webrequest]::defaultwebproxy.BypassProxyOnLocal = $true

Finally, run this command to install updates

Get-WindowsUpdate -AcceptAll -MicrosoftUpdate -Install -AutoReboot

To Disable Windows Update:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 1 /f

## OR ##

sc config wuauserv start= disabled

To Enable Windows Update:

reg add "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\WindowsUpdate\Auto Update" /v AUOptions /t REG_DWORD /d 0 /f

## OR ##

sc config wuauserv start= auto

To Pause Windows Update Service:

net stop wuauserv
net stop bits
net stop dosvc

To Resume Windows Update Service:

net start wuauserv
net start bits
net start dosvc

To Force Windows to check for updates:

wuauclt /detectnow /updatenow

Windows 10 PowerShell:

Install-Module PSWindowsUpdate
Get-WindowsUpdate
Install-WindowsUpdate

# Module agnostic
(New-Object -ComObject Microsoft.Update.AutoUpdate).DetectNow()

VBS Script to apply to remote servers:

https://community.spiceworks.com/t/windows-update-agent-force-script-email-results-version-2-8/971180

To forcefully reset Windows updated packages, it may be necessary to rename the Software Distribution folder. It is located in the Windows root directory and used to temporarily store files which may be required to install Windows Update on your computer. WUAgent depends on this during its run-time.

Ren %systemroot%\SoftwareDistribution SoftwareDistribution.bak
Ren %systemroot%\system32\catroot2 catroot2.bak
shutdown -r -t 0
Legacy Service Packs:

Starting with Windows 8, Microsoft has paused the releases of service packs in favor of distributing patches via the centralized repos. Thus, it’s a good idea to keep this list of items for older machines.

Windows Updates & Service Packs
Operating SystemService Pack / UpdateSize (MB)Download

Windows 7

Windows Server 2008

SP231632-bit
47764-bit
SP153832-bit
90364-bit
Windows Vista3SP247632-bit
57864-bit
Windows XPSP331632-bit
SP235164-bit
Windows 2000SP40.5932-bit

Downloading and applying services packs is straight forward. Here’s a screenshot of the wizard.

Windows 7 SP1

Be advised that applying services packs may not always go as planned. This is an error to show a sample of these exceptional cases.

error: 0x8004402f

Leave a Reply

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

Related Post

How to Search for Installed Application by Name in PowerShell

One can search using the known Vendor or application Name as illustrated below: [testwindows]: PS…

Block USB in Windows 7 using Group Policy

Create and assign a group policy to the appropriate OU with this configuration: Computer Configuration…

Install Fail2ban on CentOS 7 & 8

Objective: Ban all IPs that have failed logins by matching a certain policies. Here's a…
Other project: DragonCoin.com