diff --git a/powershell/public/cisa/entra/Test-MtCisaActivationNotification.ps1 b/powershell/public/cisa/entra/Test-MtCisaActivationNotification.ps1 index 27a6c1b9..126a354c 100644 --- a/powershell/public/cisa/entra/Test-MtCisaActivationNotification.ps1 +++ b/powershell/public/cisa/entra/Test-MtCisaActivationNotification.ps1 @@ -30,12 +30,16 @@ Function Test-MtCisaActivationNotification { return $null }else{ $EntraIDPlan = Get-MtLicenseInformation -Product EntraID - if($EntraIDPlan -ne "P2"){ - Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDP2 - }elseif($EntraIDPlan -ne "Governance"){ - Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDGovernance + if($EntraIDPlan -notin @("P2","Governance")){ + if($EntraIDPlan -ne "P2"){ + Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDP2 + return $null + }elseif($EntraIDPlan -ne "Governance"){ + #This will not currently be hit + Add-MtTestResultDetail -SkippedBecause NotLicensedEntraIDGovernance + return $null + } } - return $null } $roles = Get-MtRole -CisaHighlyPrivilegedRoles diff --git a/powershell/public/cisa/entra/Test-MtCisaDiagnosticSettings.ps1 b/powershell/public/cisa/entra/Test-MtCisaDiagnosticSettings.ps1 index 58e8123e..d668e69d 100644 --- a/powershell/public/cisa/entra/Test-MtCisaDiagnosticSettings.ps1 +++ b/powershell/public/cisa/entra/Test-MtCisaDiagnosticSettings.ps1 @@ -80,7 +80,7 @@ Function Test-MtCisaDiagnosticSettings { $result = "| Log Name | Result |`n" $result += "| --- | --- |`n" - foreach ($item in $array) { + foreach ($item in ($array | Sort-Object Log)) { $itemResult = $resultFail if($item.Enabled){ $itemResult = $resultPass diff --git a/powershell/public/cisa/entra/Test-MtCisaGlobalAdminRatio.ps1 b/powershell/public/cisa/entra/Test-MtCisaGlobalAdminRatio.ps1 index 19dfab14..621e0fd4 100644 --- a/powershell/public/cisa/entra/Test-MtCisaGlobalAdminRatio.ps1 +++ b/powershell/public/cisa/entra/Test-MtCisaGlobalAdminRatio.ps1 @@ -42,6 +42,7 @@ Function Test-MtCisaGlobalAdminRatio { $_.'@odata.type' -eq "#microsoft.graph.user"} If ($otherAssignments.Count) { + $ratio = 0 $ratio = $globalAdministrators.Count / $otherAssignments.Count $testResult = $ratio -le 1 } Else { @@ -55,7 +56,8 @@ Function Test-MtCisaGlobalAdminRatio { } else { $testResultMarkdown = "Your tenant does not have enough granular [role assignments]($link).`n`n%TestResult%" } - $result = "$ratio = $($globalAdministrators.Count) / $($otherAssignments.Count)" + $result = "Current Ratio: $([System.Math]::Round($ratio,2)) = $($globalAdministrators.Count) / $($otherAssignments.Count)`n" + $result += "Ratio >= 1 - $($ratio -ge 1)" $testResultMarkdown = $testResultMarkdown -replace "%TestResult%", $result Add-MtTestResultDetail -Result $testResultMarkdown