'suche nach updates und maile das Ergebnis an meinServeradmin@dom.main /rb 2011 Set updateSession = CreateObject("Microsoft.Update.Session") Set updateSearcher = updateSession.CreateupdateSearcher() DIM Mailtext,Computername,Emailadresse,Subject,SMTPServer,Absender Computername = WScript.CreateObject("WScript.Shell").ExpandEnvironmentStrings("%Computername%") Mailtext = "Liste installierbarer Updates für Rechner: " & Computername & vbCRLF & vbCrLf Emailadresse = "meinServeradmin@dom.ain" SMTPServer = "mySMTPSrv" Absender = Computername & "@dom.ain" Subject = "neue Updates auf " & Computername & " gefunden" '----- ab hier nichts mehr ändern ----- 'WScript.Echo "Suche nach updates auf " & Computername & " ..." & vbCRLF Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'") If searchResult.Updates.Count = 0 Then WScript.Echo "nix neues." WScript.Quit End If For I = 0 To searchResult.Updates.Count-1 Set update = searchResult.Updates.Item(I) 'WScript.Echo I + 1 & "> " & update.Title Mailtext = Mailtext & vbCrLf & update.Title & vbCrLf Next Mailtext = Mailtext & vbCrLf & i+1 & " Updates sind installierbar" & vbCrLf 'wscript.echo Mailtext Call Mailmirmal(Emailadresse,SMTPServer,Absender,Subject,Mailtext) ' ------------------------------------------------------------------------- Sub Mailmirmal(Emailadresse,SMTPServer,Absender,Subject,Mailtext) '////////////////////// '// Sende SMTP Mail via VBScript. '////////////////////// Const cdoSendUsingMethod = "http://schemas.microsoft.com/cdo/configuration/sendusing", _ cdoSendUsingPort = 2, _ cdoSMTPServer = "http://schemas.microsoft.com/cdo/configuration/smtpserver" '// Create the CDO connections. Dim iMsg, iConf, Flds Set iMsg = CreateObject("CDO.Message") Set iConf = CreateObject("CDO.Configuration") Set Flds = iConf.Fields '// SMTP server configuration. With Flds .Item(cdoSendUsingMethod) = cdoSendUsingPort .Item(cdoSMTPServer) = SMTPServer .Update End With '// Set the message properties. With iMsg Set .Configuration = iConf .To = Emailadresse .From = Absender .Subject = Subject .TextBody = Mailtext End With '// An attachment ? 'iMsg.AddAttachment Attachment '// Sende die mail iMsg.Send End Sub