Windows Update使用vbscript进行检查

有人的脚本/或可以帮助我检查,是否有可用的服务器的Windows更新?

所以当黄色的更新图标在任务栏中时,我会收到一封邮件。

我的想法是:发送邮件,如果wuauclt.exe在任务栏中超过10分钟。

但我不知道做这个。

我发现只有这个:

Dim strComputer, strProcess Do strProcess = inputbox( "Please enter the name of the process (for instance: explorer.exe)", "Input" ) Loop until strProcess <> "" Do strComputer = inputbox( "Please enter the computer name", "Input" ) Loop until strComputer <> "" If( IsProcessRunning( strComputer, strProcess ) = True ) Then WScript.Echo "Process " & strProcess & " is running on computer " & strComputer Else WScript.Echo "Process " & strProcess & " is NOT running on computer " & strComputer End If 

感谢帮助。

这样的事情呢?

 'Microsoft magic Set updateSession = CreateObject("Microsoft.Update.Session") Set updateSearcher = updateSession.CreateupdateSearcher() Set searchResult = updateSearcher.Search("IsInstalled=0 and Type='Software'") 'End Microsoft magic If searchResult.Updates.Count <> 0 Then 'If updates were found 'This is where you add your code to send an E-Mail. 'Send E-mail including a list of updates needed. 'This is how you can list the title of each update that was found. 'You could include the list in the body of your E-Mail. For i = 0 To searchResult.Updates.Count - 1 Set update = searchResult.Updates.Item(i) WScript.Echo update.Title Next End If 

wuauclt可能会运行超过10分钟,而不一定是通知用户有未决的更新。

我知道这是StackOverflow,这是一个编程问题,但我是一个系统管理员,我认为这属于serverFault,并且你做错了。 WSUS( http://technet.microsoft.com/en-us/wsus/default.aspx )旨在管理Windows更新。