SHELL/8.2.4.ps1
|
$CheckId = "8.2.4" $Title = "Ensure the organization cannot communicate with accounts in trial Teams tenants" $Level = "L1" $BenchmarkType = "Automated" try { $TenantFederation = Get-CsTenantFederationConfiguration -ErrorAction Stop $ExternalAccessWithTrialTenants = [string]$TenantFederation.ExternalAccessWithTrialTenants $Pass = $ExternalAccessWithTrialTenants -eq "Blocked" $Status = if ($Pass) { "PASS" } else { "FAIL" } [pscustomobject]@{ CheckId = $CheckId Title = $Title Level = $Level BenchmarkType = $BenchmarkType Status = $Status Pass = $Pass Evidence = [pscustomobject]@{ ExternalAccessWithTrialTenants = $ExternalAccessWithTrialTenants SourceDocument = "CIS_Microsoft_365_Foundations_Benchmark_v6.0.1" } Error = if ($Pass) { $null } else { "ExternalAccessWithTrialTenants is '$ExternalAccessWithTrialTenants'. It must be 'Blocked'." } 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 } } |