Here is a snippet of a script I use to gather all patches in a SUG. I take this 
and compare to all patches in the image and do a comparison in Excel. I got a 
blog post half written as well that I may publish one day.

param(
    [Parameter(Mandatory=$true)]
    [int32]$SoftwareUpdateGroupID,
    [string]$SaveTo = 'c:\temp\SUG.csv'
)

if ([IntPtr]::size -ne 8) {
    write-error "This script must be ran with 32-bit PowerShell."
} else {
    $CMModule = 'C:\Program Files (x86)\Microsoft Configuration 
Manager\AdminConsole\bin\ConfigurationManager.psd1'

    if ($CMModule) {
        Import-Module $CMModule | out-null
        Set-Location CAS:

        #Gather list of software updates from software update group and output 
to spreadsheet
        write-output "*** Saving results to $SaveTo ***"
        Get-CMSoftwareUpdate -UpdateGroupId $SoftwareUpdateGroupID | select 
ArticleID, BulletinID, @{Name="Title";Expression="LocalizedDisplayName"} | sort 
ArticleID | Export-Csv -NoTypeInformation $SaveTo

    } else {
        write-error "Please install the Configuration Manager 2012 console 
first!"
    }
}


Daniel Ratliff

From: [email protected] [mailto:[email protected]] On 
Behalf Of Corkill, Daniel
Sent: Monday, August 17, 2015 2:57 AM
To: [email protected]
Subject: [mssms] Get a list of all updates within all SUGs via PowerShell

I need to get a list of all updates within all SUGs and output them to an 
organised structure - a text file per SUG maybe. I can get the updates for each 
SUG using this:

$SUG = 'blah'
(Get-CMSoftwareUpdate -UpdateGroupName $SUG).LocalizedDisplayName

I'm not sure how to cycle through all of the SUGs and output it all neatly 
though. Any help?

Daniel.




*********************************************************************

This email, including any attachment, is confidential to the intended 
recipient.  It may also be privileged and may be subject to copyright.  If you 
have received this email in error, please notify the sender immediately and 
delete all copies of the email.  Any confidentiality or privilege is not 
waived.  Neither the Council nor the sender warrant that this email does not 
contain any viruses or other unsolicited items.



This email is an informal Council communication.  The Council only accepts 
responsibility for information sent under official letterhead and duly signed 
by, or on behalf of, the Chief Executive Officer.



Privacy Collection Notice

Logan City Council may collect your personal information, e.g. name, 
residential address, phone number etc, in order to conduct its business and/or 
meet its statutory obligations. The information will only be accessed by 
employees and/or Councillors of Logan City Council for Council business related 
activities only. If your personal information will be passed onto a third 
party, Council will advise you of this disclosure, the purpose of the 
disclosure and reason why. Your information will not be given to any other 
person or agency unless you have given us permission or we are required by law.





The information transmitted is intended only for the person or entity to which 
it is addressed
and may contain CONFIDENTIAL material.  If you receive this 
material/information in error,
please contact the sender and delete or destroy the material/information.


Reply via email to