@@ -6,27 +6,27 @@ function Invoke-CippTestORCA104 {
66 param ($Tenant )
77
88 try {
9- $AntiPhishPolicies = Get-CIPPTestData - TenantFilter $Tenant - Type ' ExoAntiPhishPolicies '
9+ $Policies = Get-CIPPTestData - TenantFilter $Tenant - Type ' ExoHostedContentFilterPolicy '
1010
11- if (-not $AntiPhishPolicies ) {
12- Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status ' Skipped' - ResultMarkdown ' No data found in database. This may be due to missing required licenses or data collection not yet completed.' - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Phish '
11+ if (-not $Policies ) {
12+ Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status ' Skipped' - ResultMarkdown ' No data found in database. This may be due to missing required licenses or data collection not yet completed.' - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Spam '
1313 return
1414 }
1515
1616 $FailedPolicies = [System.Collections.Generic.List [object ]]::new()
1717 $PassedPolicies = [System.Collections.Generic.List [object ]]::new()
1818
19- foreach ($Policy in $AntiPhishPolicies ) {
19+ foreach ($Policy in $Policies ) {
2020 if ($Policy.HighConfidencePhishAction -eq ' Quarantine' ) {
21- $PassedPolicies.Add ($Policy )
21+ $PassedPolicies.Add ($Policy ) | Out-Null
2222 } else {
23- $FailedPolicies.Add ($Policy )
23+ $FailedPolicies.Add ($Policy ) | Out-Null
2424 }
2525 }
2626
2727 if ($FailedPolicies.Count -eq 0 ) {
2828 $Status = ' Passed'
29- $Result = [System.Text.StringBuilder ]::new(" All anti-phishing policies have High Confidence Phish action set to Quarantine.`n`n " )
29+ $Result = [System.Text.StringBuilder ]::new(" All anti-spam policies have High Confidence Phish action set to Quarantine.`n`n " )
3030 $null = $Result.Append (" **Compliant Policies:** $ ( $PassedPolicies.Count ) `n`n " )
3131 if ($PassedPolicies.Count -gt 0 ) {
3232 $null = $Result.Append (" | Policy Name | Action |`n " )
@@ -37,7 +37,7 @@ function Invoke-CippTestORCA104 {
3737 }
3838 } else {
3939 $Status = ' Failed'
40- $Result = [System.Text.StringBuilder ]::new(" Some anti-phishing policies do not have High Confidence Phish action set to Quarantine.`n`n " )
40+ $Result = [System.Text.StringBuilder ]::new(" Some anti-spam policies do not have High Confidence Phish action set to Quarantine.`n`n " )
4141 $null = $Result.Append (" **Failed Policies:** $ ( $FailedPolicies.Count ) | **Passed Policies:** $ ( $PassedPolicies.Count ) `n`n " )
4242 $null = $Result.Append (" ### Non-Compliant Policies`n`n " )
4343 $null = $Result.Append (" | Policy Name | Current Action | Recommended Action |`n " )
@@ -48,10 +48,10 @@ function Invoke-CippTestORCA104 {
4848 $null = $Result.Append (" `n **Remediation:** Update the HighConfidencePhishAction to 'Quarantine' for enhanced security." )
4949 }
5050
51- Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status $Status - ResultMarkdown $Result - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Phish '
51+ Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status $Status - ResultMarkdown $Result - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Spam '
5252 } catch {
5353 $ErrorMessage = Get-CippException - Exception $_
5454 Write-LogMessage - API ' Tests' - tenant $Tenant - message " Failed to run test: $ ( $ErrorMessage.NormalizedError ) " - sev Error - LogData $ErrorMessage
55- Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status ' Failed' - ResultMarkdown " Test failed: $ ( $ErrorMessage.NormalizedError ) " - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Phish '
55+ Add-CippTestResult - TenantFilter $Tenant - TestId ' ORCA104' - TestType ' Identity' - Status ' Failed' - ResultMarkdown " Test failed: $ ( $ErrorMessage.NormalizedError ) " - Risk ' High' - Name ' High Confidence Phish action set to Quarantine message' - UserImpact ' High' - ImplementationEffort ' Low' - Category ' Anti-Spam '
5656 }
5757}
0 commit comments