Does anyone know how to pull outstanding windows updates report for all AD computers with a PowerShell script?
I don't have access to WSUS and Active directory expect for read only access.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
We get it - no one likes a content blocker. Take one extra minute and find out why we block content.
Not exactly the question you had in mind?
Sign up for an EE membership and get your own personalized solution. With an EE membership, you can ask unlimited troubleshooting, research, or opinion questions.
Unlimited question asking, solutions, articles and more.
A A
ASKER
WUU utility is for applying patches. I am not looking to apply any patches. All I need to see is pending updates for all active directory devices.
Jose, I am unable to run this script. does this script works for you? how do I save this is csv file?
I am getting this error:
Get-PendingUpdate : The term 'Get-PendingUpdate' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was
included, verify that the path is correct and try again.
At line:1 char:1
+ Get-PendingUpdate -ADcomputer
Can you please verify is this is correct:
Get-PendingUpdate -ADcomputer
{
<#
.SYNOPSIS
Retrieves the updates waiting to be installed from WSUS
.DESCRIPTION
Retrieves the updates waiting to be installed from WSUS
.PARAMETER Computername
Computer or computers to find updates for.
.EXAMPLE
Get-PendingUpdates
Description
-----------
Retrieves the updates that are available to install on the local system
.NOTES
Author: Boe Prox
#>
#Requires -version 3.0
[CmdletBinding(
DefaultParameterSetName = 'computer'
)]
param(
[Parameter(ValueFromPipeline = $True)]
[string[]$Computername = $env:COMPUTERNAME
)
Process {
ForEach ($computer in $Computername) {
If (Test-Connection -ComputerName $computer -Count 1 -Quiet) {
Try {
#Create Session COM object
Write-Verbose "Creating COM object for WSUS Session"
$updatesession = [activator]::CreateInstance([type]::GetTypeFromProgID("Microsoft.Update.Session",$computer))
}
Catch {
Write-Warning "$($Error[0])"
Break
}
#Configure Session COM Object
Write-Verbose "Creating COM object for WSUS update Search"
$updatesearcher = $updatesession.CreateUpdateSearcher()
#Configure Searcher object to look for Updates awaiting installation
Write-Verbose "Searching for WSUS updates on client"
$searchresult = $updatesearcher.Search("IsInstalled=0")
#Verify if Updates need installed
Write-Verbose "Verifing that updates are available to install"
If ($searchresult.Updates.Count -gt 0) {
#Updates are waiting to be installed
Write-Verbose "Found $($searchresult.Updates.Count) update\s!"
#Cache the count to make the For loop run faster
$count = $searchresult.Updates.Count
#Begin iterating through Updates available for installation
Write-Verbose "Iterating through list of updates"
For ($i=0; $i -lt $Count; $i++) {
#Create object holding update
$Update = $searchresult.Updates.Item($i)
[pscustomobject]@{
Computername = $Computer
Title = $Update.Title
KB = $($Update.KBArticleIDs)
SecurityBulletin = $($Update.SecurityBulletinIDs)
MsrcSeverity = $Update.MsrcSeverity
IsDownloaded = $Update.IsDownloaded
Url = $($Update.MoreInfoUrls)
Categories = ($Update.Categories | Select-Object -ExpandProperty Name)
BundledUpdates = @($Update.BundledUpdates)|ForEach{
[pscustomobject]@{
Title = $_.Title
DownloadUrl = @($_.DownloadContents).DownloadUrl
}
}
}
}
}
Else {
#Nothing to install at this time
Write-Verbose "No updates to install."
}
}
Else {
+ ~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Get-PendingUpdate:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
William Miller
@OP: Take a look here, it seems to query all devices on an AD for pending updates. There are some pre-reqs but they're also listed in the TN Gallery:
Unlimited question asking, solutions, articles and more.
A A
ASKER
or is there any script I can from sccm to find out windows updates. can I use sccm client to find out pending updates from all AD computers. again I don't have access to wsus server. I would like to see 20+ and 50 + , pending patches in csv file.
Jose Gabriel Ortega Castro
you save the script.
Go to an elevated powershell console.
Navegate to the path where you saved the script.
run the script
Thanks Jose. I will try that. I am also looking into clients not getting patches from WSUS. what could be the reason? over 500 clients are not getting patches. They are active and logging in to the system. what is stopping these machines to get patched.
Thanks.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
A A
ASKER
Hi Jose this script did not work for me.
1-please help me find the how can I get outstanding windows update for all AD computers through sccm. I don't have access to WSUS.
2-i also need help finding the Windows update agent versions for all machines in our environment. I need them both in an excel sheel.