SHELL/6.5.4.ps1
|
$CheckId = "6.5.4" $Title = "Ensure SMTP AUTH is disabled" $Level = "L1" $BenchmarkType = "Automated" try { $TransportConfig = Get-TransportConfig -ErrorAction Stop $SmtpAuthDisabled = [bool]$TransportConfig.SmtpClientAuthenticationDisabled $Pass = $SmtpAuthDisabled $Status = if ($Pass) { "PASS" } else { "FAIL" } [pscustomobject]@{ CheckId = $CheckId Title = $Title Level = $Level BenchmarkType = $BenchmarkType Status = $Status Pass = $Pass Evidence = [pscustomobject]@{ SmtpClientAuthenticationDisabled = $SmtpAuthDisabled SourceDocument = "CIS_Microsoft_365_Foundations_Benchmark_v6.0.1" } Error = if ($Pass) { $null } else { "SmtpClientAuthenticationDisabled is False. It must be True." } Timestamp = Get-Date } } catch { [pscustomobject]@{ CheckId = $CheckId Title = $Title Level = $Level BenchmarkType = $BenchmarkType Status = "ERROR" Pass = $null Evidence = [pscustomobject]@{ SourceDocument = "CIS_Microsoft_365_Foundations_Benchmark_v6.0.1" } Error = $_.Exception.Message Timestamp = Get-Date } } |