Skip to content

Commit 4822701

Browse files
authored
Version 2.4.9
1 parent 021d37b commit 4822701

File tree

1 file changed

+35
-9
lines changed

1 file changed

+35
-9
lines changed

Invoke-DGASoftwareUpdateMaintenance/Invoke-DGASoftwareUpdateMaintenance.ps1

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,13 +124,17 @@ Version 2.4.8 01/24/20
124124
Fix Boolean handling in settings file.
125125
[TODO] Sync approvals throughout hierarchy.
126126
[TODO] Orchestrate decline top-down and cleanup bottom-up throughout hierarchy.
127-
Version 2.4.9 08/13/20
127+
Version 2.4.9 09/17/20
128128
Internal code updates for Set-Location/Pop-Location, spelling, spacing, aliases/full cmdlets, etc.
129129
Add config file for datFile
130130
Update config file processing to better detect UNC and file paths
131131
Add scriptFile variable and set default config files to be scriptFile.<associated extension>
132132
Updated logging to prepend WhatIf when running in WhatIf mode
133-
Archive last output file
133+
Archive last output file
134+
Update O365 plugin with new channel names [Damien Solodow]
135+
Add several plugins [Chad Simmons, Damien Solodow]
136+
Fix the lookup for ConfigMgr supersedence settings.
137+
134138
.LINK
135139
http://www.damgoodadmin.com
136140
@@ -919,7 +923,7 @@ Param(
919923
#endregion
920924

921925
$cmSiteVersion = [version]"5.00.8540.1000"
922-
$scriptVersion = "2.4.8"
926+
$scriptVersion = "2.4.9"
923927
$component = 'Invoke-DGASoftwareUpdateMaintenance'
924928
$scriptPath = Split-Path -Path $MyInvocation.MyCommand.Definition -Parent
925929
Write-Verbose -Message "Script Path: $scriptPath"
@@ -1573,19 +1577,41 @@ If ($DeleteDeclined -or $DeclineSuperseded -or $DeclineByTitle -or $DeclineByPlu
15731577

15741578
#If no exclusion period was given then use the supersedence configuration of the SUP Component to calculate the exclusion date.
15751579
If ($null -eq $ExclusionPeriod){
1576-
1580+
15771581
#If expiring immediately then use zero months otherwise use the number of months configured
15781582
If ($StandAloneWSUS) {
15791583
$ExclusionPeriod = 3
15801584
}
1581-
ElseIf ((((Get-CMSoftwareUpdatePointComponent -SiteCode $SiteCode).Props) | Where-Object {$_.PropertyName -eq 'Sync Supersedence Mode'}).Value -eq 0){
1582-
$ExclusionPeriod = 0
1583-
} Else {
1584-
$ExclusionPeriod = (((Get-CMSoftwareUpdatePointComponent -SiteCode $SiteCode).Props) | Where-Object {$_.PropertyName -eq 'Sync Supersedence Age'}).Value
1585+
Else {
1586+
1587+
#Get the supersedence settings from ConfigMgr.
1588+
$supersedenceMode = (((Get-CMSoftwareUpdatePointComponent -SiteCode $SiteCode).Props) | Where-Object {$_.PropertyName -eq 'Sync Supersedence Mode For NonFeature'}).Value
1589+
1590+
#Verify that the product team didn't change these on us again.
1591+
if (!$supersedenceMode)
1592+
{
1593+
Add-TextToCMLog $LogFile "Failed to determine ConfigMgr's supersedence mode. Exiting without making any changes." $component 3
1594+
return
1595+
}
1596+
1597+
If ($supersedenceMode -eq 0){
1598+
$ExclusionPeriod = 0
1599+
} Else {
1600+
$supersedenceAge = (((Get-CMSoftwareUpdatePointComponent -SiteCode $SiteCode).Props) | Where-Object {$_.PropertyName -eq 'Sync Supersedence Age For NonFeature'}).Value
1601+
#Verify that the product team didn't change these on us again.
1602+
if (!$supersedenceAge)
1603+
{
1604+
Add-TextToCMLog $LogFile "Failed to determine ConfigMgr's supersedence age. Exiting without making any changes." $component 3
1605+
return
1606+
}
1607+
1608+
$ExclusionPeriod = $supersedenceAge
1609+
}
15851610
}
15861611
}
15871612
$ExclusionDate = (Get-Date).AddMonths($ExclusionPeriod * -1)
15881613

1614+
15891615
#If deleting declined updates.
15901616
If ($DeleteDeclined){
15911617
$ExclusionDateDelete = (Get-Date).AddMonths($ExclusionPeriod * -1)
@@ -1615,7 +1641,7 @@ If ($DeleteDeclined -or $DeclineSuperseded -or $DeclineByTitle -or $DeclineByPlu
16151641

16161642
#If using the built-in logic for declining superseded updates.
16171643
If($DeclineSuperseded){
1618-
Add-TextToCMLog $LogFile "Declining updates superseded before $ExclusionDate." $component 1
1644+
Add-TextToCMLog $LogFile "Declining updates superseded for $ExclusionPeriod months (before $ExclusionDate)." $component 1
16191645

16201646
#Loop through updates and add those that match the user's criteria to the hash.
16211647
ForEach ($Update in $ActiveUpdates) {

0 commit comments

Comments
 (0)