@@ -73,7 +73,7 @@ function Invoke-CIPPStandardAntiPhishPolicy {
73
73
}
74
74
75
75
$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
77
77
78
78
if ($MDOLicensed ) {
79
79
$StateIsCorrect = ($CurrentState.Name -eq $PolicyName ) -and
@@ -96,6 +96,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
96
96
($CurrentState.TargetedUserQuarantineTag -eq $Settings.TargetedUserQuarantineTag ) -and
97
97
($CurrentState.TargetedDomainProtectionAction -eq $Settings.TargetedDomainProtectionAction ) -and
98
98
($CurrentState.TargetedDomainQuarantineTag -eq $Settings.TargetedDomainQuarantineTag ) -and
99
+ ($CurrentState.EnableTargetedDomainsProtection -eq $true ) -and
100
+ ($CurrentState.EnableTargetedUserProtection -eq $true ) -and
99
101
($CurrentState.EnableOrganizationDomainsProtection -eq $true )
100
102
} else {
101
103
$StateIsCorrect = ($CurrentState.Name -eq $PolicyName ) -and
@@ -144,6 +146,8 @@ function Invoke-CIPPStandardAntiPhishPolicy {
144
146
TargetedUserQuarantineTag = $Settings.TargetedUserQuarantineTag
145
147
TargetedDomainProtectionAction = $Settings.TargetedDomainProtectionAction
146
148
TargetedDomainQuarantineTag = $Settings.TargetedDomainQuarantineTag
149
+ EnableTargetedDomainsProtection = $true
150
+ EnableTargetedUserProtection = $true
147
151
EnableOrganizationDomainsProtection = $true
148
152
}
149
153
} else {
@@ -218,8 +222,9 @@ function Invoke-CIPPStandardAntiPhishPolicy {
218
222
}
219
223
220
224
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
223
228
}
224
229
225
230
}
0 commit comments