Skip to content

Commit

Permalink
Allow show details in default policies
Browse files Browse the repository at this point in the history
  • Loading branch information
iserrano76 committed Jul 26, 2024
1 parent 208add5 commit 1273980
Showing 1 changed file with 16 additions and 12 deletions.
28 changes: 16 additions & 12 deletions M365/MDO/MDOThreatPolicyChecker.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -761,12 +761,13 @@ process {
}
if ($null -eq $malwareMatchedRule) {
Write-Host "`nMalware:`n`tDefault policy" -ForegroundColor Yellow
$malwareFilterPolicy = Get-MalwareFilterPolicy "Default"
} else {
$malwareFilterPolicy = Get-MalwareFilterPolicy $malwareMatchedRule.Name
Write-Host "`nMalware:`n`tName: $($malwareMatchedRule.Name)`n`tPriority: $($malwareMatchedRule.Priority)" -ForegroundColor Yellow
if ($malwareFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $malwareFilterPolicy
}
}
if ($malwareFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $malwareFilterPolicy
}

$antiPhishMatchedRule = $antiPhishPolicy = $null
Expand All @@ -775,12 +776,13 @@ process {
}
if ($null -eq $antiPhishMatchedRule) {
Write-Host "`nAnti-phish:`n`tDefault policy" -ForegroundColor Yellow
$antiPhishPolicy = Get-AntiPhishPolicy "Office365 AntiPhish Default"
} else {
$antiPhishPolicy = Get-AntiPhishPolicy $antiPhishMatchedRule.Name
Write-Host "`nAnti-phish:`n`tName: $($antiPhishMatchedRule.Name)`n`tPriority: $($antiPhishMatchedRule.Priority)" -ForegroundColor Yellow
if ($antiPhishPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $antiPhishPolicy
}
}
if ($antiPhishPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $antiPhishPolicy
}

$spamMatchedRule = $hostedContentFilterPolicy = $null
Expand All @@ -789,12 +791,13 @@ process {
}
if ($null -eq $spamMatchedRule) {
Write-Host "`nAnti-spam::`n`tDefault policy" -ForegroundColor Yellow
$hostedContentFilterPolicy = Get-HostedContentFilterPolicy "Default"
} else {
$hostedContentFilterPolicy = Get-HostedContentFilterPolicy $spamMatchedRule.Name
Write-Host "`nAnti-spam:`n`tName: $($spamMatchedRule.Name)`n`tPriority: $($spamMatchedRule.Priority)" -ForegroundColor Yellow
if ($hostedContentFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $hostedContentFilterPolicy
}
}
if ($hostedContentFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $hostedContentFilterPolicy
}

$outboundSpamMatchedRule = $hostedOutboundSpamFilterPolicy = $null
Expand All @@ -803,12 +806,13 @@ process {
}
if ($null -eq $outboundSpamMatchedRule) {
Write-Host "`nOutbound Spam:`n`tDefault policy" -ForegroundColor Yellow
$hostedOutboundSpamFilterPolicy = Get-HostedOutboundSpamFilterPolicy "Default"
} else {
$hostedOutboundSpamFilterPolicy = Get-HostedOutboundSpamFilterPolicy $outboundSpamMatchedRule.Name
Write-Host "`nOutbound Spam:`n`tName: $($outboundSpamMatchedRule.Name)`n`tPriority: $($outboundSpamMatchedRule.Priority)" -ForegroundColor Yellow
if ($hostedOutboundSpamFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $hostedOutboundSpamFilterPolicy
}
}
if ($hostedOutboundSpamFilterPolicy -and $ShowDetailedPolicies) {
Show-DetailedPolicy -Policy $hostedOutboundSpamFilterPolicy
}

$allPolicyDetails = $userDetails + "`n" + $allPolicyDetails
Expand Down

0 comments on commit 1273980

Please sign in to comment.