使用vbscript进行Windows更新检查

使用vbscript进行Windows更新检查,windows,vbscript,process,Windows,Vbscript,Process,是否有人提供脚本/或可以帮助我检查,是否有可用的服务器windows更新 所以当黄色的更新图标出现在任务栏上时,我会收到一封邮件 我的想法是:发送邮件,如果wauclt.exe在任务栏中的时间超过10分钟 但我不知道该怎么做 我发现只有这个: Dim strComputer, strProcess Do strProcess = inputbox( "Please enter the name of the process (for instance: explorer.exe)", "I

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

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

我的想法是:发送邮件,如果wauclt.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
Dim strc计算机,strProcess
做
strProcess=inputbox(“请输入进程名称(例如:explorer.exe)”,“输入”)
循环直到strProcess“”
做
strComputer=inputbox(“请输入计算机名”,“输入”)
循环直到strComputer“”
如果(IsProcessRunning(strComputer,strProcess)=True),则
Echo“进程”&strProcess&“正在计算机上运行”&strComputer
其他的
WScript.Echo“进程”&strProcess&“未在计算机上运行”&strComputer
如果结束

感谢您的帮助。

Wauclt很可能运行了10分钟以上,而不一定通知用户有待定的更新


我知道这是StackOverflow,这是一个编程问题,但我是一个系统管理员,我认为这属于ServerFault,而您做得不对。WSUS()设计用于管理Windows更新。

wAUCLT很可能运行超过10分钟,而不必通知用户有挂起的更新


我知道这是StackOverflow,这是一个编程问题,但我是一个系统管理员,我认为这属于ServerFault,而您做得不对。WSUS()设计用于管理Windows更新。

类似的东西怎么样

'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
微软魔术 Set updateSession=CreateObject(“Microsoft.Update.Session”) Set updatesarcher=updateSession.createUpdatesarcher() 设置searchResult=updatesarcher.Search(“IsInstalled=0,类型='Software')) “终结微软的魔力 如果searchResult.Updates.Count为0,则“如果找到更新” '这是您添加代码以发送电子邮件的地方。 '发送包含所需更新列表的电子邮件。 '这是如何列出找到的每个更新的标题。 “您可以将该列表包含在电子邮件正文中。 对于i=0的searchResult.Updates.Count-1 Set update=searchResult.Updates.Item(i) WScript.Echo update.Title 下一个 如果结束
像这样的东西怎么样

'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
微软魔术 Set updateSession=CreateObject(“Microsoft.Update.Session”) Set updatesarcher=updateSession.createUpdatesarcher() 设置searchResult=updatesarcher.Search(“IsInstalled=0,类型='Software')) “终结微软的魔力 如果searchResult.Updates.Count为0,则“如果找到更新” '这是您添加代码以发送电子邮件的地方。 '发送包含所需更新列表的电子邮件。 '这是如何列出找到的每个更新的标题。 “您可以将该列表包含在电子邮件正文中。 对于i=0的searchResult.Updates.Count-1 Set update=searchResult.Updates.Item(i) WScript.Echo update.Title 下一个 如果结束
谢谢你的回答。我们使用WSUS,但我会制作一个脚本来检查服务器列表,如果有服务器需要修补,我会收到一封邮件。你知道我的意思吗?:-)您可以直接从WSUS控制台获取报告和电子邮件警报,无需编码。它们不是非常可配置的,但是很容易看到需要修补程序的服务器列表,以及它们需要哪些修补程序…感谢您的回答。我们使用WSUS,但我会制作一个脚本来检查服务器列表,如果有服务器需要修补,我会收到一封邮件。你知道我的意思吗?:-)您可以直接从WSUS控制台获取报告和电子邮件警报,无需编码。它们不是非常可配置的,但是很容易看到需要补丁的服务器列表,以及它们需要哪些补丁。。。