locked
List WSUS updates with PowerShell RRS feed

  • Question

  • Experts,

        Does anyone have a PowerShell script that will list all Microsoft Updates rec'd on a certain date?

    I'm working with WSUS v6 server 2012R2.

    Flite23



    • Edited by Flite23 Thursday, October 15, 2015 5:37 PM
    Thursday, October 15, 2015 5:37 PM

Answers

  • Hi,

    Here is the script I used for searching the updates arrived in recent 7 days:

    [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer()
    $updatescope = New-Object Microsoft.UpdateServices.Administration.UpdateScope
    $updatescope.FromArrivalDate = (get-date).adddays(-7)
    $updatescope.ToArrivalDate = get-date
    $wsus.GetUpdates($updatescope) 

    Best Regards.


    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by Flite23 Monday, October 19, 2015 12:10 PM
    Monday, October 19, 2015 9:51 AM

All replies

  • Hi,

    Here is the script I used for searching the updates arrived in recent 7 days:

    [void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
    $wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer()
    $updatescope = New-Object Microsoft.UpdateServices.Administration.UpdateScope
    $updatescope.FromArrivalDate = (get-date).adddays(-7)
    $updatescope.ToArrivalDate = get-date
    $wsus.GetUpdates($updatescope) 

    Best Regards.


    Steven Lee Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Support, contact tnmff@microsoft.com.

    • Marked as answer by Flite23 Monday, October 19, 2015 12:10 PM
    Monday, October 19, 2015 9:51 AM
  • Thanks Steven! The script did work for me.

    Flite23


    • Edited by Flite23 Monday, October 19, 2015 12:11 PM
    Monday, October 19, 2015 12:11 PM