Link to home
Start Free TrialLog in
Avatar of mattmcg
mattmcg

asked on

WSUS report; Powershell script to get data

I am looking to get data out of my WSUS server. I need to run two monthly reports to find out how many Windows Updates were installed to my servers for each month.  I think there is some way I can use Powershell's Get-WsusComputer to get the data out.  I don't need to know what all of the updates were. I just need a total installed.  

Does anyone have an idea?  There is a InstalledOrNotApplicable variable that works with WsusUpdateInstallationState but I don't know how to put it together.  If it lists them all that's ok - I can tally things up. I just need some kind of data dump.  

Thanks
Avatar of Randy Downs
Randy Downs
Flag of United States of America image

Try this.

Blog details the script actions.

#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
ASKER CERTIFIED SOLUTION
Avatar of dan_blagut
dan_blagut
Flag of France image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of mattmcg
mattmcg

ASKER

Thanks for the information on poshWSUS. It will take me some time to figure out how to create my report but I believe the tools are within this for me to extract the data I require.