Skip to content

Commit 4500250

Browse files
committed
fix: smtp report logging
1 parent e76c738 commit 4500250

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

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

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function Invoke-CIPPStandardDisableBasicAuthSMTP {
77
.SYNOPSIS
88
(Label) Disable SMTP Basic Authentication
99
.DESCRIPTION
10-
(Helptext) Disables SMTP AUTH for the organization and all users. This is the default for new tenants.
10+
(Helptext) Disables SMTP AUTH for the organization and all users. This is the default for new tenants.
1111
(DocsDescription) Disables SMTP basic authentication for the tenant and all users with it explicitly enabled.
1212
.NOTES
1313
CAT
@@ -75,24 +75,24 @@ function Invoke-CIPPStandardDisableBasicAuthSMTP {
7575
if ($SMTPusers.Count -eq 0) {
7676
$LogMessage.add('SMTP Basic Authentication for all users is disabled')
7777
} else {
78-
$LogMessage.add("SMTP Basic Authentication for the following $($SMTPusers.Count) users is not disabled: $($SMTPusers.PrimarySmtpAddress -join ',')")
78+
$LogMessage.add("SMTP Basic Authentication for the following $($SMTPusers.Count) users is not disabled: $($SMTPusers.PrimarySmtpAddress -join ', ')")
7979
}
8080

8181
if ($Settings.alert -eq $true) {
8282

8383
if ($CurrentInfo.SmtpClientAuthenticationDisabled -and $SMTPusers.Count -eq 0) {
8484
Write-LogMessage -API 'Standards' -tenant $tenant -message 'SMTP Basic Authentication for tenant and all users is disabled' -sev Info
8585
} else {
86-
Write-LogMessage -API 'Standards' -tenant $tenant -message $LogMessage -sev Alert
86+
Write-LogMessage -API 'Standards' -tenant $tenant -message ($LogMessage -join '') -sev Alert
8787
}
8888
}
8989

9090
if ($Settings.report -eq $true) {
91-
9291
if ($CurrentInfo.SmtpClientAuthenticationDisabled -and $SMTPusers.Count -eq 0) {
9392
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $CurrentInfo.SmtpClientAuthenticationDisabled -StoreAs bool -Tenant $tenant
9493
} else {
95-
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $LogMessage -StoreAs string -Tenant $tenant
94+
$Logs = $LogMessage | Select-Object @{n = 'Message'; e = { $_ } }
95+
Add-CIPPBPAField -FieldName 'DisableBasicAuthSMTP' -FieldValue $Logs -StoreAs json -Tenant $tenant
9696
}
9797
}
9898
}

0 commit comments

Comments
 (0)