Get-WSUSReport

 

12 thoughts on “Get-WSUSReport

  1. This script is indeed a very nice piece of art!!

    Thank you very much for sharing, I have it already running in our production systems ;)

    Best regards,

  2. Great script, i was hoping someone could help me how i could add a filter to only include updates under the “Windows” classification. i.e Server OS only, no office, SQL etc etc.?

  3. wow .. what a script !!!!!!! excellent work!!!

    i did add some code to get a local copy of that report and send it as attachment (starting at line 173):

    $MailMessage | Out-File c:\temp\wsusreport.html
    # Get the date and time.
    $DateTime = Get-Date -Format “ddd MM/dd/yyyy h:mm tt”
    # Set subject line to include the $DateTime variable.
    $EmailSubject = “your subject ” + $DateTime

    # Send an email with all the compiled data.
    [string[]]$EmailTo = “yourmail@anymail.com”
    Send-MailMessage -To $EmailTo
    -Subject $EmailSubject -From "yourmail@anymail.com"

    -Body $MailMessage -BodyasHTML
    -attachment "c:\temp\wsusreport.html"

    -SmtpServer “yourmailgateway”

  4. Fantastic script! This is EXACTLY what I was hoping to do, but much nicer than how I was going to do it. What I’d like to do with it is save the htmls of all the computer groups (which the script already does) to a folder within inetpub\wwwroot and would like to know if there’s possibly a way to have it generate an index.html with links to the html files it created.

  5. I ma getting below error while running the script.

    Cannot find an overload for “getComputerTargetGroup” and the argument count: “1”.
    At Z:\WSUS\WSUS-Report.ps1:41 char:1
    + $MemberOfGroup = $wsus.getComputerTargetGroup($ComputerTargetGroups.Id).GetCompu …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

  6. Exception calling “GetUpdateServer” with “3” argument(s): “The underlying connection was closed: An unexpected error occurred on a
    send.”
    At line:25 char:1
    + $WSUS = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer(“d …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodInvocationException
    + FullyQualifiedErrorId : WebException

    Cannot find an overload for “getComputerTargetGroup” and the argument count: “1”.
    At line:41 char:1
    + $MemberOfGroup = $wsus.getComputerTargetGroup($ComputerTargetGroups.Id).GetCompu …
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : NotSpecified: (:) [], MethodException
    + FullyQualifiedErrorId : MethodCountCouldNotFindBest

    Send-MailMessage : The remote name could not be resolved: ‘MailRelayServer’
    At line:181 char:1
    + Send-MailMessage -To $EmailTo `
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    + CategoryInfo : InvalidOperation: (System.Net.Mail.SmtpClient:SmtpClient) [Send-MailMessage], SmtpException
    + FullyQualifiedErrorId : SmtpException,Microsoft.PowerShell.Commands.SendMailMessage

Leave a Reply