Send email with attached report of computers not reporting WSUS status within the last 30 days (or never)
Customize to your needs.
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
$From = "wsus@YOURDOMAIN.COM" | |
$To = "recipient@YOURDOMAIN.COM" | |
$SMTPServer = "your.smtpserver.com" | |
$Subject = "Computers not reporting status in the last 30 days" | |
$Body = "Please investigate attached report and fix any Windows update errors on each machine in the report." | |
$date = (Get-Date).AddDays(-30) | |
Get-WsusComputer -ToLastReportedStatusTime $date | Out-File c:\temp\wsusComputersNotReportedLast30Days.txt | |
Send-MailMessage -From $From -to $To -Subject $Subject -Body $Body -SmtpServer $SMTPServer -Attachments c:\temp\wsusComputersNotReportedLast30Days.txt |
Kommentarer
Send en kommentar