Send email with attached report of computers not reporting WSUS status within the last 30 days (or never)

Customize to your needs.
$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

Populære opslag fra denne blog

Microsoft Office 2016 and the AUTO_ACTIVATE property

Access Exchange online with Office 365 multi-factor authentication (MFA/2FA)

Disable logon and logoff events (event id 4624, 4625, 4634 (and all the other ones...))