Is there a way to get windows to send me an email, once a windows update is ready?

COBB, VICTOR 0 Reputation points
2023-11-16T23:18:04.5566667+00:00

My team and I monitor multiple machines at different locations, and sometimes we lose visibility to these pc's when they get a update and restart. Sometimes even getting stuck on an update and us not being able to remote in. I would like to set up some sort of email notification, informing my team and I when a new Windows update has been made available, and when the pc is planning to restart to install said updates. Is this possible to do, without monetary cost?

Windows 10
Windows 10
A Microsoft operating system that runs on personal computers and tablets.
12,077 questions
Microsoft Configuration Manager Updates
Microsoft Configuration Manager Updates
Microsoft Configuration Manager: An integrated solution for for managing large groups of personal computers and servers.Updates: Broadly released fixes addressing specific issue(s) or related bug(s). Updates may also include new or modified features (i.e. changing default behavior).
1,111 questions
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. S.Sengupta 22,356 Reputation points MVP
    2023-11-16T23:55:43.0466667+00:00

    Yes, you can receive email alerts for Windows updates. To do so, you can follow the steps below:

    Visit the Microsoft Technical Security Notifications

    Subscribe to the email alerts by selecting the type of updates you want to be notified about: Major revisions, Minor revisions, or both.

    Alternatively, you can sign up for email notifications about Windows known issues documented in the Windows release health section of the Microsoft 365 admin center.


  2. XinGuo-MSFT 21,671 Reputation points
    2023-11-17T07:15:41.39+00:00

    Hi,

    While Windows itself doesn't have a built-in feature to send email notifications specifically for Windows updates, you can achieve this by using a combination of scripting and scheduled tasks. Here's a basic outline of how you could approach this:

    1. PowerShell Script: Create a PowerShell script that checks for available updates and sends an email notification. Here's a simple example script:
       # Check for available updates
       $updates = Get-HotFix -Description "Update" | Where-Object {$_.InstalledOn -eq $null}
    
       if ($updates) {
           # Send email notification
           $smtpServer = "your-smtp-server.com"
           $smtpFrom = "your-email@example.com"
           $smtpTo = "team-member1@example.com", "team-member2@example.com"
           $messageSubject = "Windows Updates Available"
           $messageBody = "New Windows updates are available. Please check the server."
    
           $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
           $smtp.Send($smtpFrom, $smtpTo, $messageSubject, $messageBody)
       }
    
    # Function to check for pending updates
    function Check-Updates {
        $updateSession = New-Object -ComObject Microsoft.Update.Session
        $updateSearcher = $updateSession.CreateUpdateSearcher()
    
        $searchResult = $updateSearcher.Search("IsInstalled=0")
    
        return $searchResult.Updates.Count
    }
    
    # Function to send email notification
    function Send-EmailNotification {
        $smtpServer = "your-smtp-server.com"
        $smtpFrom = "your-email@example.com"
        $smtpTo = "team-member1@example.com", "team-member2@example.com"
        $messageSubject = "Windows Updates Installed"
        $messageBody = "Windows updates have been installed successfully. The system is ready."
    
        $smtp = New-Object Net.Mail.SmtpClient($smtpServer)
        $smtp.Send($smtpFrom, $smtpTo, $messageSubject, $messageBody)
    }
    
    # Check for pending updates
    $updateCount = Check-Updates
    
    if ($updateCount -gt 0) {
        Write-Host "Pending updates found. Waiting for updates to finish installation..."
    
        # Wait for updates to finish installing
        while (Check-Updates -gt 0) {
            Start-Sleep -Seconds 300  # Sleep for 5 minutes
        }
    
        Write-Host "Updates have been installed. Sending email notification..."
        
        # Send email notification
        Send-EmailNotification
    } else {
        Write-Host "No pending updates found."
    }
    
    

    Save this script with a .ps1 extension.

    1. Scheduled Task: Use the Task Scheduler to run this script at regular intervals. You can set the task to run daily or as frequently as needed. Make sure to configure the task to run with the necessary privileges.
      • Open Task Scheduler.
      • Create a new task.
      • Set the trigger (e.g., daily) and the action to start a program, pointing to powershell.exe and providing the path to your script as an argument.
    2. SMTP Server: You need an SMTP server to send emails. If you don't have one, you can use a public SMTP server or set up your own. Be cautious about using public servers for sensitive information.

    Note: This approach doesn't directly notify you about pending restarts due to updates. You might need to consider additional scripting or monitoring tools to achieve that level of granularity.

    Remember to test the script thoroughly before deploying it to production systems. Also, this solution assumes you have the necessary permissions to run scripts and configure scheduled tasks on the target machines.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.