Skip to content

Instantly share code, notes, and snippets.

@elvarb
Created May 20, 2012 21:22
Show Gist options
  • Save elvarb/2759572 to your computer and use it in GitHub Desktop.
Save elvarb/2759572 to your computer and use it in GitHub Desktop.
Powershell: WSUS Nodes Update Report
import-module poshwsus
connect-wsusserver WSUS.domain.com
$nodes = Get-WSUSUpdateSummaryPerClient -ComputerScope (New-WSUSComputerScope) -UpdateScope (New-WSUSUpdateScope) | sort-object NeededCount -descending | select-object Computer,LastUpdated,NeededCount,InstalledPendingRebootCount,InstalledCount,FailedCount
$emailto = "email@domain.com"
$emailfrom = "wsus@domain.com"
$message = $null
$message += "
<html>
<head>
<title>My first styled page</title>
<style type='text/css'>
table {
border-collapse:collapse;
}
table, th, td {
border: 1px solid gray;
}
th {
padding-left:15px;
padding-right:15px;
font: 12px arial;
}
td {
padding-left:15px;
padding-right:15px;
font: 12px arial;
}
</style>
</head>
<body>
"
$message += $nodes | ConvertTo-HTML -fragment
$message += "</body></html>"
SendEmail.ps1 -Subject "[WSUS] Nodes Needing Updates" -message $message -to $emailto -from $emailfrom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment