Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

Is it possible to have Windows send me an email when an update is required to complete updates? I have my server setup to install updates automatically, but not restart afterwards. I have found that I can add actions for events in the event viewer, but I don't know what to look for.

share|improve this question
1  
is this server in production? You should install updates manually... –  Campo Sep 23 '10 at 19:47
    
This server is in production. Can I send email notifications when new updates are available then? –  JamesArmes Sep 23 '10 at 20:04
add comment

4 Answers

Here is a portion of a PowerShell script I have set to run daily on a few of my servers.

##############################################
##    Review windows updates   ##
##############################################

$update = new-object -com Microsoft.update.Session
$searcher = $update.CreateUpdateSearcher()
$result = $searcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0")

if ($result.updates.count -gt 0 ) 
{
    $updatealert = 1
    $update_body += "<hr><h1 style="" font-family: 'arial'"">There are ("+$result.updates.count+") pending Windows updates:</h1><table BORDER=1 BORDERCOLOR=#C2C2C2>"

    foreach($update in $result.updates)
    {
       $update_body += "<tr  style="" font-family: 'arial' font-size: 7px border:2px groove #FFFFFF"" bgcolor=#FFFF00><td>" + $update.Title + "</td><td>" + $update.Description + "</td></tr>"
       $i++
    }

    $update_body += "</table>"
}

The full script sends an html email with other info, but right at the top it tells me every day if there are Windows updates available.

share|improve this answer
add comment

Yes. You can attach a task (send an email) to an event so you can have your server send you an email when it reboots and gives you one of the "standard" Windows starting events in the event log.

share|improve this answer
    
The problem is that I don't want it to reboot; I just want it to email me when it needs to reboot to finish installing updates. –  JamesArmes Sep 28 '10 at 15:08
    
You get to choose which event log alert to use as the trigger. This doesn't actually reboot the server this will email you based on the event log entry you choose. –  Mitch Sep 28 '10 at 17:35
add comment

There must be a method of doing this. It's just a matter of figuring out how to detect that updates are available.

Check out the Windows Update API below. There are some script examples of how to detect if updates are available. A similar method could be used with a PowerShell script.

http://msdn.microsoft.com/en-us/library/aa387102(v=VS.85).aspx

Cheers, Trevor Sullivan

share|improve this answer
add comment

Are you using WSUS?

If you are, when you approve updates and they get installed, if the updates don't need a reboot the machines will show zero updates needed.

If they do need a reboot there will always be outstanding updates shown as even if the updates have been installed, until you reboot it won't register back to WSUS that the updates have been installed.

Hopefully that makes sense.

share|improve this answer
    
We are not using WSUS, as this is our only Windows server. –  JamesArmes Sep 23 '10 at 20:03
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.