none
WSUS - console says update is Needed, powershell says it is not. RRS feed

  • Question

  • Hi Everybody,

    Lately I wanted to make a script that will approve all needed updates, I have met a problem while trying to determine updates from report in powershell. Wsus console shows me that there are many of "Failed or Needed" updates:

    But as I try to retrieve that list with powershell by command:

    $wsus.GetUpdates() | where {$_.isApproved -match "false" -and ($_.State -eq "Needed" -or $_.State -match "Failed")} | ft title

    I got... nothing, so I tried to check what is the state of those updates, so I have queried one of them by title, and it appered that the state is "NotNeeded":

    Can somebody explain me please what is going on :)

    Wednesday, August 15, 2012 10:35 PM

All replies

  • Can somebody explain me please what is going on :)

    Maybe they failed when they were needed.. but now they're not needed anymore?

    Maybe IE9 is already installed?


    Lawrence Garvin, M.S., MCITP:EA, MCDBA, MCSA
    Product Manager, SolarWinds
    Microsoft MVP - Software Distribution (2005-2012)
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin

    Thursday, August 16, 2012 10:16 PM
    Moderator
  • Even if it would be true and they failed - shouldn't the status be like "Failed"?

    I doubt the situation is because IE9 is installed, it is the same with other updates, for ex.:

    I am wondering, how updates in reports are being determine? Why for God's sake the console says different data than powershell? :)


    Friday, August 17, 2012 8:53 AM
  • Even if it would be true and they failed - shouldn't the status be like "Failed"?

    What makes you think it isn't? You're filtering on "Failed OR Needed" updates. We know the status is not "Needed"; most clearly it is "Not Needed", ergo, the update still has a status of "Failed" and shows up in your filter.

    Why for God's sake the console says different data than powershell? :)

    Because you're comparing apples to oranges.

    The console will show ANY update as Failed if it has Failed once and never been successfully installed subsequent to the failure.

    The PowerShell query is showing you the *current* state of the update.

    The real question here is "Why is IE9 reported as Not Needed?"


    Lawrence Garvin, M.S., MCITP:EA, MCDBA, MCSA
    Product Manager, SolarWinds
    Microsoft MVP - Software Distribution (2005-2012)
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin

    Friday, August 17, 2012 5:11 PM
    Moderator
  • First of all thank you kindly for you help, you said that:

    "...ergo, the update still has a status of "Failed" and shows up in your filter."

    As I filtered just failed updates in WSUS console -  there were no updates showed, simply zero...

    So it seemes the status in console is "Needed," and still powershell says "NotNeeded".

    Tuesday, August 21, 2012 4:58 PM