File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
Modules/CIPPCore/Public/Standards Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -44,15 +44,16 @@ function Invoke-CIPPStandardSpoofWarn {
4444
4545 try {
4646 $CurrentInfo = (New-ExoRequest - tenantid $Tenant - cmdlet ' Get-ExternalInOutlook' )
47- }
48- catch {
47+ } catch {
4948 $ErrorMessage = Get-NormalizedError - Message $_.Exception.Message
5049 Write-LogMessage - API ' Standards' - Tenant $Tenant - Message " Could not get the SpoofWarn state for $Tenant . Error: $ErrorMessage " - Sev Error
5150 return
5251 }
5352
5453 # Get state value using null-coalescing operator
5554 $state = $Settings.state.value ?? $Settings.state
55+
56+ $IsEnabled = $state -eq ' enabled'
5657 $AllowListAdd = $Settings.AllowListAdd.value ?? $Settings.AllowListAdd
5758
5859 # Test if all entries in the AllowListAdd variable are in the AllowList
@@ -131,7 +132,7 @@ function Invoke-CIPPStandardSpoofWarn {
131132 if ($Settings.report -eq $true ) {
132133 Add-CIPPBPAField - FieldName ' SpoofingWarnings' - FieldValue $CurrentInfo.Enabled - StoreAs bool - Tenant $Tenant
133134
134- if ($AllowListCorrect -eq $true -and $CurrentInfo.Enabled -eq $status ) {
135+ if ($AllowListCorrect -eq $true -and $CurrentInfo.Enabled -eq $IsEnabled ) {
135136 $FieldValue = $true
136137 } else {
137138 $FieldValue = $CurrentInfo | Select-Object Enabled, AllowList
You can’t perform that action at this time.
0 commit comments