Updated Reporting & 24H2 Updates Remediation

This commit is contained in:
Andrew Amason
2025-07-22 09:55:32 -04:00
parent 9c8438d7d1
commit 0092fa4a0f
6 changed files with 86 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
[datetime]$dtToday = [datetime]::NOW
$strCurrentMonth = $dtToday.Month.ToString()
$strCurrentYear = $dtToday.Year.ToString()
[datetime]$dtMonth = $strCurrentMonth + '/1/' + $strCurrentYear
while ($dtMonth.DayofWeek -ne 'Tuesday') {
$dtMonth = $dtMonth.AddDays(1)
}
$strPatchTuesday = $dtMonth.AddDays(7)
$intOffSet = 7
if ([datetime]::NOW -lt $strPatchTuesday -or [datetime]::NOW -ge $strPatchTuesday.AddDays($intOffSet)) {
$objUpdateSession = New-Object -ComObject Microsoft.Update.Session
$objUpdateSearcher = $objUpdateSession.CreateupdateSearcher()
$arrAvailableUpdates = @($objUpdateSearcher.Search("IsAssigned=1 and IsHidden=0 and IsInstalled=0").Updates)
$strAvailableCumulativeUpdates = $arrAvailableUpdates | Where-Object {$_.title -like "*cumulative*"}
if ($strAvailableCumulativeUpdates -eq $null) {
$strUpdateStatus = @{"Update status" = "Up-to-date"}
}
else {
$strUpdateStatus = @{"Update status" = "Not up-to-date"}
}
}
else {
$strUpdateStatus = @{"Update status" = "Up-to-date"}
}
return $strUpdateStatus | ConvertTo-Json -Compress

View File

@@ -0,0 +1,18 @@
{
"Rules":[
{
"SettingName":"Update status",
"Operator":"IsEquals",
"DataType":"String",
"Operand":"Up-to-date",
"MoreInfoUrl":"https://support.microsoft.com/en-us/topic/windows-11-version-24h2-update-history-0929c747-1815-4543-8461-0160d16f15e5",
"RemediationStrings":[
{
"Language":"en_US",
"Title":"Device must be running the latest cumulative update for Windows.",
"Description": "Please make sure that the latest cumulative update for Windows is installed."
}
]
}
]
}