Automating Patch Management with WuInstall — Step‑by‑Step Guide
Introduction
WuInstall is a lightweight command‑line tool that lets you script Windows Update operations (search, download, install) and integrate them into automated workflows. This guide shows a practical, safe path to set up automated patching with WuInstall across clients and servers.
1. What you’ll need
- Windows machines (clients/servers) with administrative access.
- WuInstall.exe (download from wuinstall.com) placed on each target or on an automation host that can run commands remotely.
- A management method: scheduled Task, Group Policy startup/shutdown script, remote execution (PsExec/PowerShell Remoting), or an RMM.
- Optional: WSUS in your environment (WuInstall works with or without WSUS).
- Basic knowledge of PowerShell/Batch scripting.
2. WuInstall basics (commands)
- Search available updates:
Code
wuInstall /search
- Download updates to local cache:
Code
wuInstall /download
- Install updates:
Code
wuInstall /install
Key useful flags:
- /quiet — suppress UI
- /norestart or /disableprompt — prevent immediate reboot prompts
- /rebootcycle — continue installing across required reboots automatically
- /cache:[path] — use custom cache location
- /log:[file] — write detailed log
3. Design a safe rollout strategy
- Create a small test group (3–10 machines) — validate updates and reboot behavior.
- Staged rollout: test → pilot (small department) → broad deployment.
- Define maintenance windows and enforce user-friendly hours (nightly or weekend).
- Keep a rollback plan: snapshots, backups, and an approval/hold list for problematic KBs.
4. Sample automation flows
A. Nightly install on unattended servers (PowerShell scheduled task)
- Script (run as SYSTEM or admin):
Code
wuInstall /install /quiet /rebootcycle /log:“C:\Logs\wuinstall-install.log”
- Schedule: daily at 02:00, with task configured to run whether user is logged on and to restart on failure.
B. Bandwidth-friendly clients: download off-hours, install during maintenance window
- 01:00 — download:
Code
wuInstall /download /cache:“C:\WUCache” /log:“C:\Logs\wuinstall-download.log”
- 03:00 — install from cache:
Code
wuInstall /install /cache:“C:\WUCache” /quiet /rebootcycle /log:“C:\Logs\wuinstall-install.log”
C. Targeted KB installs (single patch)
- Search for a KB and install by filter (example installs updates whose title contains “KB500”):
Code
wuInstall /install /filter:“KB500” /quiet /log:“C:\Logs\wuinstall-kb500.log”
D. Remote execution using PsExec or PowerShell Remoting (example with Invoke-Command)
Code
Invoke-Command -ComputerName Server01 -ScriptBlock { Start-Process -FilePath “C:\Tools\wuInstall.exe” -ArgumentList ‘/install /quiet /rebootcycle’ -Wait }
5. Logging, reporting and monitoring
- Always use /log or redirect stdout to capture outcome. Keep logs centrally (syslog/SMB share) for analysis.
- Parse WuInstall logs and Windows Update event logs to create compliance reports. Example fields to collect: machine, datetime, updates found, updates installed, reboot required, exit code.
- Monitor for non-checkin or repeated failures and create alerts for >N% failure rate.
6. Handling reboots and reboot cycles
- For unattended multi-update installs that require multiple reboots, use /rebootcycle to let WuInstall continue across reboots.
- If you must control reboot timing, use /norestart during /install and schedule a controlled reboot afterwards:
Code
wuInstall /install /quiet /norestart shutdown /r /t 300 /c “Planned update reboot”
7. Using WSUS vs. Microsoft Update
- If WSUS is in place, WuInstall will respect it by default. To bypass WSUS (e.g., to get an urgent patch not yet on WSUS):
Code
wuInstall /install /usewuapi
(Confirm exact bypass flag in your WuInstall version docs; test before broad use.)
8. Common automation pitfalls and remedies
- Permission issues: ensure the account running WuInstall has local admin rights.
- Network/Firewall: allow update/download traffic and any ports needed for remote execution.
- Caching: clean or rotate caches to avoid disk fill. Use /cache to centralize.
- Stuck updates: clear Windows Update cache (Stop wuauserv, delete SoftwareDistribution\Download), then retry with WuInstall /download.
- Conflicting management tools: coordinate SCCM/Intune/WSUS settings to avoid competing update controls.
9. Example rollout checklist
- Download and verify WuInstall.exe on management host(s).
- Build test scripts for /search, /download, /install with logging.
- Configure test group scheduled runs and validate behavior for 2–3 cycles.
- Document maintenance windows and communication plan.
- Stage deployment: test → pilot → full.
- Implement monitoring, central log collection, and alerting for failures.
10. Resources
- Official WuInstall documentation and options page (wuinstall.com/documentation).
- Use controlled test KBs and a lab environment before production runs.
Conclusion
WuInstall is ideal for scriptable, flexible Windows Update automation. Use staged rollouts, centralized logging, and scheduled tasks or RMM integration to automate patch management reliably and safely.
Leave a Reply