Windows Vista Tips

Windows Vista Tips > Newsgroups > Windows Server > Update Services > Re: Scripting API: Find High Priority updates only

Reply
Thread Tools Display Modes

Re: Scripting API: Find High Priority updates only

 
 
PA Bear [MS MVP]
Guest
Posts: n/a

 
      09-17-2009
[Crossposted & Followup set to WSUS newsgroup]

Start here: http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx

PS: Ur spiel chukkers broke


Tonne wrote:
> Im trying to detect pending hugh priority updates using the API:
> Set objSearcher = CreateObject("Microsoft.Update.Searcher")
> Set objResults = objSearcher.Search("Type='Software' and
> IsInstalled=0")
> Set colUpdates = objResults.Updates
>
> count = 0
> titles = ""
> For i = 0 to colUpdates.Count - 1
> If colUpdates.Item(i).MsrcSeverity = "Critical" Or
> colUpdates.Item(i).MsrcSeverity = "Important" Then
> count = count + 1
> titles = titles & vbCRLF & colUpdates.Item(i).Title
> End If
> Next
>
> If Count > 0 Then
> Wscript.Echo count & " pending updates:" & titles
> Wscript.Quit 2
> Else
> Wscript.Echo "No pending updates"
> Wscript.Quit 0
> End If
>
> But MsrcSeverity only indicates security risc and I cannot find any other
> property that is helpful.
>
> Is it possible?


 
Reply With Quote
 
 
 
 
Tonne
Guest
Posts: n/a

 
      09-17-2009
Been there. I believe I have read all topics but to no avail.
--
Tonne


"PA Bear [MS MVP]" wrote:

> [Crossposted & Followup set to WSUS newsgroup]
>
> Start here: http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx
>
> PS: Ur spiel chukkers broke
>
>
> Tonne wrote:
> > Im trying to detect pending hugh priority updates using the API:
> > Set objSearcher = CreateObject("Microsoft.Update.Searcher")
> > Set objResults = objSearcher.Search("Type='Software' and
> > IsInstalled=0")
> > Set colUpdates = objResults.Updates
> >
> > count = 0
> > titles = ""
> > For i = 0 to colUpdates.Count - 1
> > If colUpdates.Item(i).MsrcSeverity = "Critical" Or
> > colUpdates.Item(i).MsrcSeverity = "Important" Then
> > count = count + 1
> > titles = titles & vbCRLF & colUpdates.Item(i).Title
> > End If
> > Next
> >
> > If Count > 0 Then
> > Wscript.Echo count & " pending updates:" & titles
> > Wscript.Quit 2
> > Else
> > Wscript.Echo "No pending updates"
> > Wscript.Quit 0
> > End If
> >
> > But MsrcSeverity only indicates security risc and I cannot find any other
> > property that is helpful.
> >
> > Is it possible?

>
>

 
Reply With Quote
 
Lawrence Garvin [MVP]
Guest
Posts: n/a

 
      09-17-2009

"Tonne" <> wrote in message
news:7FA83ED0-5C89-4938-B135-...

>> Tonne wrote:
>> > Im trying to detect pending hugh priority updates using the API:
>> > Set objSearcher = CreateObject("Microsoft.Update.Searcher")
>> > Set objResults = objSearcher.Search("Type='Software' and
>> > IsInstalled=0")
>> > Set colUpdates = objResults.Updates
>> >
>> > count = 0
>> > titles = ""
>> > For i = 0 to colUpdates.Count - 1
>> > If colUpdates.Item(i).MsrcSeverity = "Critical" Or
>> > colUpdates.Item(i).MsrcSeverity = "Important" Then
>> > count = count + 1
>> > titles = titles & vbCRLF & colUpdates.Item(i).Title
>> > End If
>> > Next
>> >
>> > If Count > 0 Then
>> > Wscript.Echo count & " pending updates:" & titles
>> > Wscript.Quit 2
>> > Else
>> > Wscript.Echo "No pending updates"
>> > Wscript.Quit 0
>> > End If
>> >
>> > But MsrcSeverity only indicates security risc and I cannot find any
>> > other
>> > property that is helpful.
>> >
>> > Is it possible?


>> Start here: http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx


> Been there. I believe I have read all topics but to no avail.
> --
> Tonne


I believe the challenge revolves around the concept of "HighPriority"
updates.. and this concept is really unique to the WU/MU environment and is
designed to target the consumer's state of mind. This is really a
presentation value that makes a distinction between "HighPriority" which is
offered by default to all AU/WU/MU clients, and "Important", which is really
a classification for optional updates - but Microsoft doesn't want to really
use the word Optional, or else the update will be completely ignored. At
least by calling them "Important", some consumer will look at them and try
to make an informed decision.

Within the catalog metadata, though, what you'll want to extract to get the
equivalent of "HighPriority" updates is done by Update Classification. In
general, "HighPriority" includes all SecurityUpdates, all CriticalUpdates,
and *some* UpdateRollups or Updates classifications. Unfortunately, a
specific definition of the terms "HighPriority" and "Important" (or
"Optional") is hard to come by.

To that end, though, in a corporate/organizational setting, you probably do
want to script your tool against the Update Classification, including all
Security Updates (or maybe Security Updates that are only Critical and
Important) and Critical Updates (which contains bug fixes for defects that
can affect system stability or product functionality).


--
Lawrence Garvin, M.S., MCITP:EA, MCDBA
Principal/CTO, Onsite Technology Solutions, Houston, Texas
Microsoft MVP - Software Distribution (2005-2009)

My Blog: http://onsitechsolutions.spaces.live.com
Microsoft WSUS Website: http://www.microsoft.com/wsus
My MVP Profile: http://mvp.support.microsoft.com/pro...awrence.Garvin

 
Reply With Quote
 
PA Bear [MS MVP]
Guest
Posts: n/a

 
      09-17-2009
[So much for the web-interface server honoring Followup To settings...]

Tonne wrote:
> Been there. I believe I have read all topics but to no avail.
>
>> [Crossposted & Followup set to WSUS newsgroup]
>>
>> Start here: http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx
>>
>> PS: Ur spiel chukkers broke
>>
>>
>> Tonne wrote:
>>> Im trying to detect pending hugh priority updates using the API:
>>> Set objSearcher = CreateObject("Microsoft.Update.Searcher")
>>> Set objResults = objSearcher.Search("Type='Software' and
>>> IsInstalled=0")
>>> Set colUpdates = objResults.Updates
>>>
>>> count = 0
>>> titles = ""
>>> For i = 0 to colUpdates.Count - 1
>>> If colUpdates.Item(i).MsrcSeverity = "Critical" Or
>>> colUpdates.Item(i).MsrcSeverity = "Important" Then
>>> count = count + 1
>>> titles = titles & vbCRLF & colUpdates.Item(i).Title
>>> End If
>>> Next
>>>
>>> If Count > 0 Then
>>> Wscript.Echo count & " pending updates:" & titles
>>> Wscript.Quit 2
>>> Else
>>> Wscript.Echo "No pending updates"
>>> Wscript.Quit 0
>>> End If
>>>
>>> But MsrcSeverity only indicates security risc and I cannot find any
>>> other
>>> property that is helpful.
>>>
>>> Is it possible?


 
Reply With Quote
 
Tonne
Guest
Posts: n/a

 
      09-18-2009
Thank you!

My revised script:
<job>
<script language="VBScript">
' check this category for 'High Priority' updates
category = "UpdateClassification"
highpriority = ",Security Updates,Update Rollups,Critical Updates,"

' create instance of update.searcher (offline)
Set objSearcher = CreateObject("Microsoft.Update.Searcher")
objSearcher.Online = 1

' find and fetch collection of updates
Set objResults = objSearcher.Search("Type='Software' and IsInstalled=0")
Set colUpdates = objResults.Updates

count = 0
titles = ""
For i = 0 to colUpdates.Count - 1
' check categories
Set colCategories = colUpdates.Item(i).Categories
For c = 0 to colCategories.Count - 1
If colCategories.item(c).Type = category _
And InStr(highPriority, "," & colCategories.item(c).Name & ",") > 0
Then
count = count + 1
titles = titles & vbCRLF & colUpdates.Item(i).Title
End If
Next
Next

If count > 0 Then
Wscript.Echo count & " pending updates:" & titles
Wscript.Quit 2
Else
Wscript.Echo "No pending updates"
Wscript.Quit 0
End If
</script>
</job>

--
Henrik Tonnesen
attentive as


"Lawrence Garvin [MVP]" wrote:

> "Tonne" <> wrote in message
> news:7FA83ED0-5C89-4938-B135-...
>
> >> Tonne wrote:
> >> > Im trying to detect pending hugh priority updates using the API:
> >> > Set objSearcher = CreateObject("Microsoft.Update.Searcher")
> >> > Set objResults = objSearcher.Search("Type='Software' and
> >> > IsInstalled=0")
> >> > Set colUpdates = objResults.Updates
> >> >
> >> > count = 0
> >> > titles = ""
> >> > For i = 0 to colUpdates.Count - 1
> >> > If colUpdates.Item(i).MsrcSeverity = "Critical" Or
> >> > colUpdates.Item(i).MsrcSeverity = "Important" Then
> >> > count = count + 1
> >> > titles = titles & vbCRLF & colUpdates.Item(i).Title
> >> > End If
> >> > Next
> >> >
> >> > If Count > 0 Then
> >> > Wscript.Echo count & " pending updates:" & titles
> >> > Wscript.Quit 2
> >> > Else
> >> > Wscript.Echo "No pending updates"
> >> > Wscript.Quit 0
> >> > End If
> >> >
> >> > But MsrcSeverity only indicates security risc and I cannot find any
> >> > other
> >> > property that is helpful.
> >> >
> >> > Is it possible?

>
> >> Start here: http://msdn.microsoft.com/en-us/libr...99(VS.85).aspx

>
> > Been there. I believe I have read all topics but to no avail.
> > --
> > Tonne

>
> I believe the challenge revolves around the concept of "HighPriority"
> updates.. and this concept is really unique to the WU/MU environment and is
> designed to target the consumer's state of mind. This is really a
> presentation value that makes a distinction between "HighPriority" which is
> offered by default to all AU/WU/MU clients, and "Important", which is really
> a classification for optional updates - but Microsoft doesn't want to really
> use the word Optional, or else the update will be completely ignored. At
> least by calling them "Important", some consumer will look at them and try
> to make an informed decision.
>
> Within the catalog metadata, though, what you'll want to extract to get the
> equivalent of "HighPriority" updates is done by Update Classification. In
> general, "HighPriority" includes all SecurityUpdates, all CriticalUpdates,
> and *some* UpdateRollups or Updates classifications. Unfortunately, a
> specific definition of the terms "HighPriority" and "Important" (or
> "Optional") is hard to come by.
>
> To that end, though, in a corporate/organizational setting, you probably do
> want to script your tool against the Update Classification, including all
> Security Updates (or maybe Security Updates that are only Critical and
> Important) and Critical Updates (which contains bug fixes for defects that
> can affect system stability or product functionality).
>
>
> --
> Lawrence Garvin, M.S., MCITP:EA, MCDBA
> Principal/CTO, Onsite Technology Solutions, Houston, Texas
> Microsoft MVP - Software Distribution (2005-2009)
>
> My Blog: http://onsitechsolutions.spaces.live.com
> Microsoft WSUS Website: http://www.microsoft.com/wsus
> My MVP Profile: http://mvp.support.microsoft.com/pro...awrence.Garvin
>

 
Reply With Quote
 
 
 
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Scripting API: Find High Priority updates only Tonne Windows Update 5 09-18-2009 12:29 PM
High-Priority Updates malopr Windows Update 5 04-17-2008 02:30 PM
High Priority Updates Autumn1938 Windows Update 1 01-07-2006 06:03 PM
High-priority updates on CD ? Bruce A. Johnson Windows Update 1 11-21-2005 12:57 AM
WindowsUpdate high priority updates not downloaded by Automatic Updates PhiL M. Windows Update 2 09-20-2004 06:18 PM



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59