-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added wsus report script and created staging-scripts folder
- Loading branch information
Jesse Russell
committed
Nov 19, 2018
1 parent
709b2b3
commit 2be7d4b
Showing
3 changed files
with
51 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
debug.log | ||
debug.log | ||
.vs | ||
staging-scripts |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
# This script grabs WSUS information and outputs it to a HTML report. Run it from the WSUS server. | ||
# File paths | ||
$reportPath = $PSScriptRoot + "\report.html" | ||
$date = Get-Date | ||
# Get server | ||
$server = Get-WsusServer -Name "localhost" -PortNumber 8530 | ||
# Grab critical updates | ||
$critical = Get-WsusUpdate -UpdateServer $server -Status FailedOrNeeded -Classification Critical -Approval Unapproved | Select-Object -Property UpdateId,Approved,ComputersNeedingThisUpdate,ComputersInstalledOrNotApplicable,ComputersWithNoStatus | Sort-Object -Descending -Property ComputersNeedingThisUpdate | ||
$critHtml = $critical | ConvertTo-Html -Fragment -PreContent "<h1>Critical & Needed/Failed & Unapproved Updates - $date</h1>" | ||
# Create HTML file | ||
$head = @" | ||
<title>Critical Updates</title> | ||
<style> | ||
body { | ||
background-color: #FFFFFF; | ||
font-family: sans-serif; | ||
} | ||
h1 { | ||
color: #1E87F0; | ||
} | ||
h2 { | ||
color: #1E87F0; | ||
} | ||
table { | ||
background-color: #1E87F0; | ||
} | ||
td { | ||
background-color: #FFFFFF; | ||
color: #666666; | ||
padding: 3px; | ||
} | ||
th { | ||
background-color: #1E87F0; | ||
color: #FFFFFF; | ||
text-align: left; | ||
padding: 3px; | ||
} | ||
</style> | ||
"@ | ||
|
||
|
||
# Convert everything to HTML and output to file | ||
ConvertTo-Html -Head $head -Body "$critHtml" | Out-File $reportPath |