Scripting Automatic Updates to get the Recommended updates, not Important or Optional

Where I work the policy is to download Recommended updates, and I'm getting very tangled up working out how to select them with a script. Can anyone help me please?
If my query includes AutoSelectOnWebSites=1 then I get the Important updates. Without that I get the Optional ones. I'm getting the impression that the Recommended ones are chosen by the Windows o/s, not by the web site, but I'm not sure and can't find
the algorithm.
Here's the relevant part of the code I've got so far.
 If ($UpdatesRequired = $True) {
#  $SearchQuery = "IsInstalled=0 and Type='Software' and IsHidden=0"
  $SearchQuery = "IsInstalled=0 and Type='Software' and IsHidden=0 and AutoSelectOnWebSites=1"
#  $SearchQuery = "IsInstalled=0 and IsHidden=0"
#  $SearchQuery = "AutoSelectOnWebSites=1"
        try {
            $SearchResult = $UpdateSearcher.Search($SearchQuery)
        } catch {
   $SearchError = $error[0]
   $OutputString = $OutputString + "ERROR: searching for Windows updates failed, the error message was $($SearchError.Exception)."
   Write-AppEventLog -EventType Error -MessageText $OutputString
   Return
  if ($SearchResult.Updates.Count -eq 0) {
   $OutputString = $OutputString + "No new updates were found."
   Write-AppEventLog -EventType Information -MessageText $OutputString
  else {
$i = 1
   $OutputString = $OutputString + "$($SearchResult.Updates.Count) new updates were found, checking which to select...`r`n`r`n"
   # most of the next code is copied from
http://sushihangover.blogspot.co.uk/2013/01/installing-windows-updates-via.html#!/2013/01/powershell-optimize-volume-vs-process.html   
   $UpdatesToDownload = New-Object -ComObject 'Microsoft.Update.UpdateColl'
   ForEach ($Update in $SearchResult.Updates) {
    $addThisUpdate = $false
    if ($Update.InstallationBehavior.CanRequestUserInput) {
     $OutputString = $OutputString + "Skipping: $($Update.Title) because it requires user input.`r`n"
    elseif ($Update.Categories -contains "68C5B0A3-D1A6-4553-AE49-01D3A7827828") { 
     $OutputString = $OutputString + "Skipping: $($Update.Title) because it is a service pack.`r`n"
    else {
     if ($Update.EulaAccepted -eq $false) {$Update.AcceptEula()}
     $addThisUpdate = $true
    if ($addThisUpdate) {
     $UpdatesToDownload.Add($Update) | Out-Null
     $OutputString = $OutputString + "Adding: $($Update.Title).`r`n"
write-host "$i patches selected for download"
$i++

Thanks for this jrv and I do like your signature by the way. I've had a long look at the most popular script in the gallery for Windows Update, this one:
http://gallery.technet.microsoft.com/2d191bcd-3308-4edd-9de2-88dff796b0bc. Also loads of others on the internet.
Some download everything, and the ones which don't select updates using a criteria with the search as per
http://msdn.microsoft.com/en-us/library/windows/desktop/aa386526(v=vs.85).aspx, and/or filter the search results using the IUpdate properties
http://msdn.microsoft.com/en-us/library/windows/desktop/aa386907(v=vs.85).aspx.
I don't think there's an IUpdate property or search criteria which correstponds to Recommended updates, I can't see one anyway and I've spent ages looking. I'm wondering if Windows chooses, not the web site, based on its knowledge of what's installed.
The AutoSelectOnWebSites property isn't what I need. It selects updates which the Windows Update gui calls Important when "Give me recommended updates the same way I receive Important updates" is
unticked. The requirement where I work is to install the Recommended updates. I've tested it several times and I've confirmed that on plenty of the Recommended updates
AutoSelectOnWebSites is set to false (on all of the updates in the example below)
Here's an example:
With "Give me recommended updates..." unticked I get:
With "Give me recommended updates..." ticked I get:
I think I need to know how Recommended updates are selected, and I can't think of any more digging I can do. Jrv, if you or anyone else knows I would be grateful!

Similar Messages

  • When trying to update, I get the message: Account not in this store,...switch to the Canadian store.  How do I do that?

    When trying to update apps, I get the message:  "Account not in this store,...switch to the Canadian store before purchasing"  How to I switch, and how did it even get changed to US store?  I don't remember changing anything, and I used to be able to update, no problem..  I have synced with my computer for music - could it have happened then?  I changed on the computer to Cdn site, but will it not go to the iPhone automatically?

    On you iPhone go to settings-iTunes & AppStore.
    Tap user name, sign out.
    Log back in with your apple ID and password.
    That should fix the problem

  • After update LR 5.4, the program will not import new pictures

    After update of LR 5.4 on my laptop, I cannot import any new pictures anymore.
    I did the same update on my desktop and there it was no problem at all.
    Does anyone know how to solve this problem??

    I am importing from a verbatim ssd, and I just don't get the chance to choose an import, I don't see any pictures to choose from. Ans what ever I pick it won't work
    On my desktop it was no problem at all. But my laptop gives my trouble.
    I do not have any error messages
    Verstuurd vanaf mijn iPad
    Op 21 jun. 2014 om 20:42 heeft "ssprengel" <[email protected]> het volgende geschreven:
    after update LR 5.4, the program will not import new pictures
    created by ssprengel in Photoshop Lightroom - View the full discussion
    Where are you importing from?  What type of Import (Copy, Move, Add)?  What is the destination specified at the righthand side?
    Any error messages?
    Please note that the Adobe Forums do not accept email attachments. If you want to embed a screen image in your message please visit the thread in the forum to embed the image at https://forums.adobe.com/message/6482328#6482328
    Replies to this message go to everyone subscribed to this thread, not directly to the person who posted the message. To post a reply, either reply to this email or visit the message page:
    To unsubscribe from this thread, please visit the message page at . In the Actions box on the right, click the Stop Email Notifications link.
    Start a new discussion in Photoshop Lightroom by email or at Adobe Community
    For more information about maintaining your forum email notifications please go to http://forums.adobe.com/thread/416458?tstart=0.

  • Automatic updates not detecting latest version

    I could not find a mention of this in the forums or the bug database.
    I have noticed for a few months now...going back to at least the update from Update 6 to Update 7:
    The automatic update function does not work. Going to the Java control panel applet, it reports version 1.5.0 (build 1.5.0_07-b03), however it says that I have the latest version of Java for this platform (Windows XP).
    Is there a workaround for this problem? This problem makes keeping several machines updated a PITA.
    Is the java bug database the place to report this problem? If so, is it already there?
    It's strange to only see articles mentioning this problem very recently:
    http://blog.washingtonpost.com/securityfix/2006/08/sun_acknowledges_major_oops_in.html
    david

    In addition to the automatic updates not detecting that Version 1.5.0 (build 1.5.0_07-b03) is not the latest Update 9, the official site, java.com, has old downloads, as well.
    Both the Download Now link and the Manual Download links to Version 5.0 Update 6.
    ??

  • Is there any way to automatically update not on cellular

    Is there any way to automatically update not on cellular but on wifi like on android? I am wanting to leave update automatically on but not cellular for updates but I need cellular for iTunes match. It seams that there is no choice for wifi when available. I went through a ton of data with app updates on cellular.

    Hi All updates since ios 7 can be done over Wifi I have not used a pc for updates or anything for over a year Go to settings turn cellular data off that will restrict all data to Wifi Cheers Brian

  • On a Mac, in Adobe Photoshop CC 2014, when adding audio to an edit, i get the message "Could not complete your request, because Dynamiclink is not available". When performing the exact same operation in Adobe Photoshop CC, i can add audio in the same way,

    On a Mac, in Adobe Photoshop CC 2014, when adding audio to an edit, i get the message "Could not complete your request, because Dynamiclink is not available".
    When performing the exact same operation in Adobe Photoshop CC, i can add audio in the same way, no error message. Any ideas to solve this, anyone? Would be greatly appreciated.

    I tried to update and it keeps telling me to get the Application Manager. And this is what happens
    Adobe Application Manager failed and it told me to download the Adobe Support Advisor.
    Adobe Support Advisor told me that there was an issue:" cpsid_82829s1: "A restart is pending," bootstrapper error has occurred. "Token Number: 40-87772-063201122012
    I followed the instructions it gave me to correct this issue:
    If you receive the error "Installer has detected that a machine restart is pending. It is recommended that you quit the installer, restart try again," do the following:
    #Restart the computer and try the installation again.
    #If the installation fails, delete the InProgress registry key: 
    Disclaimer: This procedure involves editing the Windows registry. Adobe doesn't provide support for editing the registry, which contains critical system and application information. Make sure to back up the registry before editing it. For more information about the registry, see Windows registry information for advanced users on the Microsoft support site, or contact Microsoft. 
    Launch Windows Registry Editor.
    (Windows XP) Choose Start > Run, type regedit in the Open text box and click OK.
    (Windows Vista/ Windows 7) Choose Start, type regedit in the Search box, and press Enter.
    Navigate to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager.
    Delete the InProgress key.
    I was not able to find the "InProgress" key.

  • Every time i try to install itunes on my laptop for windows  i get the message''key not valid for use in specified state''  any clue? '

    every time i try to install itunes on my laptop for windows  i get the message''key not valid for use in specified state''  any clue?

    For "Key not valid for use in specified state" errors try moving the folder RSA from C:\Users\<User>\AppData\Roaming\Microsoft\Crypto\RSA to say C:\<User>\RSA (just in case there should be a need to restore it) then try installing again. This folder appears to act as a cache and should be rebuilt automatically as required.
    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down the page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • I can not download the Golf digest magazine purchased from the i-tunes store, when i attempt i get the message "can not install item, restart app and down load" i have tried that without success. This started after i changed ipads

    I can  not access my Golf digest down loads from the newstand, when i try to down load purchased items i get the message "can not install item, please restart the app and down load" that piece of advice has not helped, any one else encountered this?

    chicx wrote:
    This is the third time of writing this on your Apple Support Communities!
    Not with your current user id.
    Far too much uneccesary information in your post, which only confuses things, a vast amount!
    Let's start with iTunes.
    Have you updated iTunes to 11.1.5, because the previous version did appear to have an issue about seeing iPods?
    With iTunes 11.1.5 installed, look in Edit/Preferences/Devices, (or use the ALT key, followed by the E key and then the F key) and make sure that the box named Prevent iPods, iPhones and iPads from syncing automatically does not have a tick in the box.
    Once you have doen those two things, check to see if the iPod is seen by iTunes.
    chicx wrote:
    By the way, what does IOS mean? (I thought IO stood for operating system, but am flummoxed by the S on the end.
    Really?
    OS stands for Operating System. (In computer speak, IO means Input/Output.)
    iOS originally stood for iPhone Operating System, but it now refers to the iPod Touch and iPhone. The iPod Classic, which you have listed in your profile as your iPod, does not use iOS.
    I assume that you have been listening to the Podcast in your iTunes on the computer as you cannot transfer it to your iPod. It's what I'd do.

  • HT4623 My new iPad can no longer connect to the 3G network. I keep getting the message "could not activate cellular date network".

    I updated my new iPad to the iOS 6 while connected to wifi. However, it will no longer connect to the 3G network. I keep getting the message "could not activate cellular data network" even though the 3G symbol appears normal. I have tried rebooting, but it still doesn't work. Please help!

    No. You can't

  • Most of the time, when I try to load the home page, I get the message server not found - now I get this message and can't go anywhere

    I have dial up - once I connect to the internet, I get the message server not found and am unable to go anywhere on the internet. This started trying to load my banks online site and started about a week ago. I've tried freeing popup blocker, gone through the settings with a bank IT specialist, tried to us IE which has resulted in a request for a cable and now no access to any website. Any suggestions appreciated. Thanks

    A possible cause is security software (firewall) that blocks or restricts Firefox or the plugin-container process without informing you, possibly after detecting changes (update) to the Firefox program.<br />
    Remove all rules for Firefox from the permissions list in the firewall and let your firewall ask again for permission to get full unrestricted access to internet for Firefox and the plugin-container process and the updater process.
    See:
    * https://support.mozilla.com/kb/Server+not+found
    * https://support.mozilla.com/kb/Firewalls

  • Since upgrading my iPhone 5 to ios 7, I cannot get the internet, email to work on 3g.  I get the message ""could not activate mobile data network. You are not subscribed to a mobile data service".  How do I fix it?

    Since upgrading my iPhone 5 to ios 7, I cannot get the internet, email to work on 3g.  I get the message ""could not activate mobile data network. You are not subscribed to a mobile data service".  How do I fix it?
    I've contacted o2, tried all of their suggested updates and changes, reset my phone 3 times and still no luck.
    Any help appreciated.
    Thanks,
    Louisa

    Hi, l have the same problem, were you able to resolve?

  • HT4009 Unfortunately, I keep getting the error "can not connect to iTunes. Code:0" I've tried rebooting, signing out of my apple ID, can someone please help or advise me on what to do? Many thanks, Ryan

    Unfortunately, I keep getting the error "can not connect to iTunes. Code:0" I've tried rebooting, signing out of my apple ID, can someone please help or advise me on what to do? Many thanks, Ryan

    hi i had the same problem today when i updated my itunes to latest version. however, i have just found my songs in the 'itunes media' folder. this was accessed through 'my music'  then keep clicking through until you find itunes media and all my library songs were in there and i then just added these files to my library and all were restored however, i have lost all my playlists but at least my 700 songs are back. very dissapointed with apple that they have let this happen with their latest update, the previous version was miles better than this one . hope you find them. stevo

  • I am trying to join my wireless network and I am getting the error "Could not join" A connection timeout occurred.

    I am trying to join my wireless network and I am getting the error "Could not join" A connection timeout occurred.
    Any suggestions

    It is very tough to help you when you don't fill out your profile, this is needed to get an idea of what your system looks like. Please read the Profile Update for instructions. Once you post that info then we have a starting point to begin helping you.

  • I am having trouble re insalling itunes i get the message "Could not access network location %APPDATA%|.

    Help  can't install or uninstall itunes keep getting the message " could not access network location %APPDATA%\, "

    And follow this:
    http://support.apple.com/kb/HT1925
    Apple moved some drivers for 64-bit now to where they should have been.
    Quicktime also use to place files outside the norm.
    One of the reasons I recommend when it comes to Apple:
    Wait for the ".1" and always use the uninstaller first and then install.
    That means you may want manual standalone installer instead - and that way you have 10.4.1 in case you need to later downgrade.

  • I recently replaced my dead airport router with a netgear91-5g router and synced it successfully to my Lexmark Pro 915 printer and my computer and yet when I try to print wirelessly I get the message: "printer not connected; printer offline".

    I recently replaced my dead airport router with a Netgear91-5g router and synced it successfully to my Lexmark Pro 915 printer and my computer; yet when I try to print wirelessly I get the message: "printer not connected; printer offline". Lexmark support verified that my printer was connected to the new router and the problem was with the computer's printer configuration and they could reconfigure it online if I paid for their "Premium Support" services ($119 for one year, 3 fixes). I declined, feeling sure that this is something I could do if I knew how. Could it be an incompatability issue with OS 10.8.3?

    You saved me $$$ that I can ill afford on my fixed income. I was very unhappy with the "support" from Lexmark... what a rip off!  Thank you dwb!

Maybe you are looking for

  • G3 won't boot 8.6 or 9 Install CD's

    I have a B&W G3 that currently has 10.2 on it. I'm trying to install the original system on it (8.6), but it hangs or freezes when it reaches the "Happy Mac" on startup. I've also tried booting from an OS 9 CD (Universal installer), and it does the s

  • Way to Erase All Start/Stop Time Data?

    I used a DJ plugin called BPMer to load the BPMs into all my MP3s. It had an option "Optimize Start and Stop Times." This helps the program skip ambient intros of songs in order to beatmatch, mix and crossfade more efficiently. The only problem is th

  • Need help recovering files form external drive!

    Well, I made a stupid mistake this morning. I am used to the Windows style of copying where if you have folders with the same name and it asks if you want to overwrite the folder, it typically merges the contents. Apparently in OSX, when you overwrit

  • Internetsales (ISA) 6.20 with ECC 6.00

    Hi we are currently migrating our R/3 Enterprise WAS 6.20 System to ECC 6.0 Our R/3 System is connected to an ISA 6.20 System which servs as ISA & TREX. We would like to connect our ISA 6.20 System to our ECC 6.0 SP13 System. Does anyone knows if the

  • Selling a used iphone to a bulk buyer

    I'm selling some old iPhones I have to a person that seems to be buying in bulk. it's a CL listing saying that they'll buy any models and pay cash. they are offering pretty good prices. Should I be concerned? Are there any scams out there like this?