Output Windows Update Results - Windows
Log In or Register to download the BES file, and more.

1 Votes

Versioning - This is the latest version.

1Output Windows Update Results - Windows TODO12/21/2016 3:41:44 PM
2Output Windows Update Results - Windows12/23/2016 3:39:35 PM


Property Details

ID23123
StatusBeta - Preliminary testing ready for more
TitleOutput Windows Update Results - Windows
DomainBESC
Download Size0
SourceInternal
Source IDjgstew
Source Release Date12/21/2016 12:00:00 AM
Is TaskTrue
Added by on 12/23/2016 3:39:35 PM
Last Modified by on 12/23/2016 3:39:35 PM
Counters 3803 Views / 73 Downloads
User Rating 1 star 2 star 3 star 4 star 5 star * Average over 2 ratings. ** Log In or Register to add your rating.

Relevance

isWindows (Relevance 1172)
Used in 1118 fixlets and 524 analyses   * Results in a true/false
Show indented relevance
windows of operating system
Used in 1 fixlet   * Results in a true/false
Show indented relevance
not exists files "results_WindowsUpdates.ini" whose(now - modification time of it < 7*day AND exists lines containing "Hidden=" of it) of folders "Logs" of folders "__Global" of data folders of client

Actions

Action 1 (default)

Action Link Click here to deploy this action.
Script Type BigFix Action Script
// https://github.com/jgstew/tools/blob/master/VBS/WUA_Search.vbs
delete __createfile
createfile until _END_OF_FILE_

' This script determines what updates are applicable on a Windows machine using the WUA api.
' Usage: cscript WUA_Search.vbs //Nologo > WindowsUpdates.ini
' Source: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387102(v=vs.85).aspx
' Modifications by @jgstew in 2016 - Public Domain

' It is possible to do this "offline": https://msdn.microsoft.com/en-us/library/windows/desktop/aa387290(v=vs.85).aspx

Set updateSession = CreateObject("Microsoft.Update.Session")
updateSession.ClientApplicationID = "Check for Windows Updates"

Set updateSearcher = updateSession.CreateUpdateSearcher()

' Method: https://msdn.microsoft.com/en-us/library/windows/desktop/aa386526(v=vs.85).aspx
Set searchResult = updateSearcher.Search("IsInstalled=0")
' also works as a single line: Set searchResult = CreateObject("Microsoft.Update.Session").CreateUpdateSearcher().Search("IsInstalled=0")

WScript.Echo "[Windows Updates]" & vbCRLF & "Number= " & searchResult.Updates.Count

numHidden = 0
numSoftware = 0
numDriver = 0

For I = 0 To searchResult.Updates.Count-1
' IUpdate interface: https://msdn.microsoft.com/en-us/library/windows/desktop/aa386099(v=vs.85).aspx
Set update = searchResult.Updates.Item(I)

' Update Type Enum: https://msdn.microsoft.com/en-us/library/windows/desktop/aa387284(v=vs.85).aspx
updateTypeStr = "Unknown"
If 1=update.Type Then
updateTypeStr = "Software"
numSoftware = numSoftware + 1
ElseIf 2=update.Type Then
updateTypeStr = "Driver"
numDriver = numDriver + 1
End If

WScript.Echo updateTypeStr & I + 1 & "= " & update.Title

If update.IsHidden Then
numHidden = numHidden + 1
End If
Next

WScript.Echo "Hidden= " & numHidden
WScript.Echo "Software= " & numSoftware
WScript.Echo "Driver= " & numDriver

' Related:
' - https://thwack.solarwinds.com/community/application-and-server_tht/patchzone/blog/2012/10/05/how-the-windows-update-agent-determines-the-status-of-an-update
' - https://bigfix.me/fixlet/details/23096
' - https://github.com/jgstew/bigfix-content/blob/master/fixlet/Output%20Windows%20Update%20Results%20-%20Windows.bes

_END_OF_FILE_

delete "{ download path "WUA_Search.vbs" }"
move __createfile "{ download path "WUA_Search.vbs" }"

waithidden cmd /c cscript __Download\WUA_Search.vbs //Nologo > __Download\results_WindowsUpdates.ini

delete "{pathnames of folders "__Global\Logs" of data folders of client}\results_WindowsUpdates.ini"
move __Download\results_WindowsUpdates.ini "{pathnames of folders "__Global\Logs" of data folders of client}\results_WindowsUpdates.ini"
Success Criteria

This action will be considered successful when the applicability relevance evaluates to false.


Sharing

Social Media:
Share this page on Yammer

Comments

Log In or Register to leave comments!