@@ -73,7 +73,7 @@ function Invoke-CIPPStandardAntiPhishPolicy {
7373 }
7474
7575 $CurrentState = $ExistingPolicy |
76- Select-Object Name, Enabled, PhishThresholdLevel, EnableMailboxIntelligence, EnableMailboxIntelligenceProtection, EnableSpoofIntelligence, EnableFirstContactSafetyTips, EnableSimilarUsersSafetyTips, EnableSimilarDomainsSafetyTips, EnableUnusualCharactersSafetyTips, EnableUnauthenticatedSender, EnableViaTag, AuthenticationFailAction, SpoofQuarantineTag, MailboxIntelligenceProtectionAction, MailboxIntelligenceQuarantineTag, TargetedUserProtectionAction, TargetedUserQuarantineTag, TargetedDomainProtectionAction, TargetedDomainQuarantineTag, EnableOrganizationDomainsProtection
76+ Select-Object Name, Enabled, PhishThresholdLevel, EnableMailboxIntelligence, EnableMailboxIntelligenceProtection, EnableSpoofIntelligence, EnableFirstContactSafetyTips, EnableSimilarUsersSafetyTips, EnableSimilarDomainsSafetyTips, EnableUnusualCharactersSafetyTips, EnableUnauthenticatedSender, EnableViaTag, AuthenticationFailAction, SpoofQuarantineTag, MailboxIntelligenceProtectionAction, MailboxIntelligenceQuarantineTag, TargetedUserProtectionAction, TargetedUserQuarantineTag, TargetedDomainProtectionAction, TargetedDomainQuarantineTag, EnableOrganizationDomainsProtection, EnableTargetedDomainsProtection , EnableTargetedUserProtection
7777
7878 if ($MDOLicensed ) {
7979 $StateIsCorrect = ($CurrentState.Name -eq $PolicyName ) -and
@@ -96,6 +96,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
9696 ($CurrentState.TargetedUserQuarantineTag -eq $Settings.TargetedUserQuarantineTag ) -and
9797 ($CurrentState.TargetedDomainProtectionAction -eq $Settings.TargetedDomainProtectionAction ) -and
9898 ($CurrentState.TargetedDomainQuarantineTag -eq $Settings.TargetedDomainQuarantineTag ) -and
99+ ($CurrentState.EnableTargetedDomainsProtection -eq $true ) -and
100+ ($CurrentState.EnableTargetedUserProtection -eq $true ) -and
99101 ($CurrentState.EnableOrganizationDomainsProtection -eq $true )
100102 } else {
101103 $StateIsCorrect = ($CurrentState.Name -eq $PolicyName ) -and
@@ -144,6 +146,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
144146 TargetedUserQuarantineTag = $Settings.TargetedUserQuarantineTag
145147 TargetedDomainProtectionAction = $Settings.TargetedDomainProtectionAction
146148 TargetedDomainQuarantineTag = $Settings.TargetedDomainQuarantineTag
149+ EnableTargetedDomainsProtection = $true
150+ EnableTargetedUserProtection = $true
147151 EnableOrganizationDomainsProtection = $true
148152 }
149153 } else {
@@ -218,8 +222,9 @@ function Invoke-CIPPStandardAntiPhishPolicy {
218222 }
219223
220224 if ($Settings.report -eq $true ) {
221- Set-CIPPStandardsCompareField - FieldName ' standards.AntiPhishPolicy' - FieldValue $StateIsCorrect - TenantFilter $tenant
222- Add-CIPPBPAField - FieldName ' AntiPhishPolicy' - FieldValue $StateIsCorrect - StoreAs bool - Tenant $tenant
225+ $FieldValue = $StateIsCorrect ? $true : $CurrentState
226+ Set-CIPPStandardsCompareField - FieldName ' standards.AntiPhishPolicy' - FieldValue $FieldValue - TenantFilter $Tenant
227+ Add-CIPPBPAField - FieldName ' AntiPhishPolicy' - FieldValue $StateIsCorrect - StoreAs bool - Tenant $Tenant
223228 }
224229
225230}
0 commit comments