Skip to content

Commit e28f691

Browse files
authored
Merge pull request #287 from KelvinTegelaar/dev
[pull] dev from KelvinTegelaar:dev
2 parents c9df7b1 + 5f0a032 commit e28f691

File tree

4 files changed

+11
-8
lines changed

4 files changed

+11
-8
lines changed

Modules/CIPPCore/Public/Entrypoints/HTTP Functions/Tenant/Standards/Invoke-listStandardTemplates.ps1

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
using namespace System.Net
22

3-
Function Invoke-listStandardTemplates {
3+
function Invoke-listStandardTemplates {
44
<#
55
.FUNCTIONALITY
66
Entrypoint,AnyTenant
@@ -29,7 +29,11 @@ Function Invoke-listStandardTemplates {
2929
return
3030
}
3131
$Data | Add-Member -NotePropertyName 'GUID' -NotePropertyValue $_.GUID -Force
32-
if ($Data.excludedTenants) { $Data.excludedTenants = @($Data.excludedTenants) }
32+
if ($Data.excludedTenants -and $Data.excludedTenants -ne 'excludedTenants') {
33+
$Data.excludedTenants = @($Data.excludedTenants)
34+
} else {
35+
$Data.excludedTenants = @()
36+
}
3337
$Data
3438
} | Sort-Object -Property templateName
3539

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardEXODisableAutoForwarding.ps1

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,7 @@ function Invoke-CIPPStandardEXODisableAutoForwarding {
3838
$CurrentInfo = New-ExoRequest -tenantid $Tenant -cmdlet 'Get-HostedOutboundSpamFilterPolicy' -cmdParams @{Identity = 'Default' } -useSystemMailbox $true
3939
$StateIsCorrect = $CurrentInfo.AutoForwardingMode -eq 'Off'
4040

41-
If ($Settings.remediate -eq $true) {
42-
41+
if ($Settings.remediate -eq $true) {
4342
try {
4443
New-ExoRequest -tenantid $tenant -cmdlet 'Set-HostedOutboundSpamFilterPolicy' -cmdParams @{ Identity = 'Default'; AutoForwardingMode = 'Off' } -useSystemMailbox $true
4544
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Disabled auto forwarding' -sev Info
@@ -50,7 +49,6 @@ function Invoke-CIPPStandardEXODisableAutoForwarding {
5049
}
5150

5251
if ($Settings.alert -eq $true) {
53-
5452
if ($StateIsCorrect -eq $true) {
5553
Write-LogMessage -API 'Standards' -tenant $tenant -message 'Auto forwarding is disabled.' -sev Info
5654
} else {
@@ -60,9 +58,8 @@ function Invoke-CIPPStandardEXODisableAutoForwarding {
6058
}
6159

6260
if ($Settings.report -eq $true) {
63-
$state = $StateIsCorrect ? $true : $CurrentInfo | Select-Object autoForwardingMode
61+
$state = $StateIsCorrect ?? ($CurrentInfo | Select-Object AutoForwardingMode)
6462
Set-CIPPStandardsCompareField -FieldName 'standards.EXODisableAutoForwarding' -FieldValue $state -TenantFilter $Tenant
6563
Add-CIPPBPAField -FieldName 'AutoForwardingDisabled' -FieldValue $StateIsCorrect -StoreAs bool -Tenant $tenant
6664
}
67-
6865
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardSpamFilterPolicy.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ function Invoke-CIPPStandardSpamFilterPolicy {
241241
if ($StateIsCorrect) {
242242
$FieldValue = $true
243243
} else {
244-
$FieldValue = $CurrentState ? $CurrentState : @{ state = 'Spam filter policy not found' }
244+
$FieldValue = $StateIsCorrect -eq $true ? $true : ($CurrentState ?? @{ state = 'Spam filter policy not found' })
245245
}
246246
Set-CIPPStandardsCompareField -FieldName 'standards.SpamFilterPolicy' -FieldValue $FieldValue -Tenant $Tenant
247247
}

Modules/CIPPCore/Public/Standards/Invoke-CIPPStandardUserSubmissions.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,6 +196,8 @@ function Invoke-CIPPStandardUserSubmissions {
196196
if ($StateIsCorrect) {
197197
$FieldValue = $true
198198
} else {
199+
$PolicyState = $PolicyState | Select-Object EnableReportToMicrosoft, ReportJunkToCustomizedAddress, ReportNotJunkToCustomizedAddress, ReportPhishToCustomizedAddress, ReportJunkAddresses, ReportNotJunkAddresses, ReportPhishAddresses
200+
$RuleState = $RuleState | Select-Object State, SentTo
199201
$FieldValue = @{ PolicyState = $PolicyState; RuleState = $RuleState }
200202
}
201203

0 commit comments

Comments
 (0)