Scripted check for outstanding Windows Updates

Created by Jeremy Burgess, Modified on Fri, 20 Sep, 2024 at 11:45 AM by Jeremy Burgess

Symptoms

You are managing several Windows servers and want to check for available Windows updates.

Cause

n/a

Resolution

This assumes that you are running Powershell as admin and that your account has administrative access to any other named computer.

# Use this if "The term 'get-windowsupdate' is not recognized as a name of a cmdlet, function, script file, or executable program."
Install-Module -Name PSWindowsUpdate -RequiredVersion 2.2.0.3

# Restart Powershell if you just installed the module
Powershell

# To get updates from the local computer only
Get–WindowsUpdate

# Or run on multiple computers
foreach ($computer in @('computer1', 'computer2', 'computer3') ) {
    Get-WindowsUpdate -ComputerName $computer
}

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article