Forums on Intune, SCCM, and Windows 11

Welcome to the forums. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your topics and posts, as well as connect with other members through your own private inbox!

NEW Get All Security Updates in a Software Update Group

  • Thread starter Thread starter KoreBreach
  • Start date Start date
  • Replies Replies 0
  • Views Views 5K

KoreBreach

New Member
Messages
1
Reaction score
0
Points
1
I've been trying to find a way, via Powershell, to get a list of security updates in a collection. The Get-CMSoftwareUpdate commandlet can be run with parameters for the name of the collection OR the update category... but not both. So far, the only thing I've been able to get to work is the following Powershell code, but it takes about 1-2 minutes to spit out each update name, which is far too slow. The ultimate goal is to run a command against a Software Group of all monthly updates to get a list of just the "security" update names. (After this, I will need to duplicate most of the code to get a list of just the "non-security" update names, essentially categorizing all monthly updates into two separate lists for automation purposes, since each are handled differently at my organization).

Set-Location 'C:\Program Files (x86)\Microsoft Endpoint Manager\AdminConsole\bin'
Import-Module .\ConfigurationManager.psd1
Set-Location CAS:
$ab = Get-CMSoftwareUpdateCategory -Fast -Name "Security Updates"
$aa = Get-CMSoftwareUpdateGroup -Name "MySUG" | Get-CMSoftwareUpdate -Fast
foreach ($update in $aa) {
$ac = Get-CMSoftwareUpdate -Fast -Name $update.localizeddisplayname -Category $ab
$ac.localizeddisplayname }

Can anyone think of another way to do this that might be faster?
 
Last edited:

Forum statistics

Threads
7,197
Messages
28,085
Members
18,358
Latest member
ludorip

Latest posts

Back
Top