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?
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: