WSUS Server HTML Report

While presenting at the Philly PowerShell User Group on Thursday, one of the things that I showed in my examples was an HTML report that I wrote for WSUS. This report basically does a report on various components of a WSUS server to include its version as well as the upstream server that it is using to synchronize with.

User Required Information

The following areas require some user interaction in order to properly run the script. Some may not be required, but should still be reviewed prior to running the script.

#region User Specified WSUS Information
$WSUSServer = 'DC1'

#Accepted values are "80","443","8350" and "8351"
$Port = 80 
$UseSSL = $False

#Specify when a computer is considered stale
$DaysComputerStale = 30 

#Send email of report
[bool]$SendEmail = $FALSE
#Display HTML file
[bool]$ShowFile = $TRUE
#endregion User Specified WSUS Information

#region User Specified Email Information
$EmailParams = @{
    To = 'user@domain.local'
    From = 'WSUSReport@domain.local'    
    Subject = "$WSUSServer WSUS Report"
    SMTPServer = 'exchange.domain.local'
    BodyAsHtml = $True
}
#endregion User Specified Email Information

By default, the script will create an HTML file and open the report once it has completed.

What Does This Report On?

A list of the currently active report sections are below:

  • WSUS Server
    • WSUS Information
    • WSUS Server Content Drive
    • Last Server Synchronization
    • Upstream Server Information
    • Automatic Approvals
    • Child Servers
    • WSUS Database
  • WSUS Client Information
    • Computer Statistics
    • Grouped By Operating System
    • Stale Computers
    • Computers Not Assigned to a Target Group
    • Failed Update Installations By Computer
    • Computers with a Pending Reboot
  • WSUS Update Information
    • Update Statistics
    • Failed Update Installations by Update
  • Target Group Information
    • Target Group Statistics
    • Empty Target Groups

I have plans for more things to report on, but wanted to get the initial script out for public consumption and to see areas where I can improve on this and add more things based on comments.

Here is a small example of the output:

image

Until then, head over to the link below to download the script and let me know what you think!

http://gallery.technet.microsoft.com/scriptcenter/WSUS-HTML-Report-655a8f28

About Boe Prox

Microsoft Cloud and Datacenter MVP working as a SQL DBA.
This entry was posted in powershell, WSUS and tagged , , , . Bookmark the permalink.

2 Responses to WSUS Server HTML Report

  1. Graeme says:

    Great Script Boe! We’re making a few changes for our environment (and using some code in an Audit script we have). Question though, in your Set-AlternatingCSSClass section, is it possible to loop through the portion of the HTML to check if it says “Fail” to set the background color via a CSSFailClass to red?

    Thanks for all the scripts, you’ve really helped some of our WSUS stuff.

  2. Babcockscott says:

    I’ve done something similar and am also including the KB article as part of the html report. Check out my second of a three part series where the report is compiled. http://get-mailbox.net/wsus-reporting-with-powershell-part-2

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s