SHELL/7.2.2.ps1
|
$CheckId = "7.2.2" $Title = "Ensure SharePoint and OneDrive integration with Azure AD B2B is enabled" $Level = "L1" $BenchmarkType = "Automated" try { $TenantConfig = Get-SPOTenant -ErrorAction Stop $EnableAzureADB2BIntegration = [bool]$TenantConfig.EnableAzureADB2BIntegration $Pass = $EnableAzureADB2BIntegration $Status = if ($Pass) { "PASS" } else { "FAIL" } [pscustomobject]@{ CheckId = $CheckId Title = $Title Level = $Level BenchmarkType = $BenchmarkType Status = $Status Pass = $Pass Evidence = [pscustomobject]@{ EnableAzureADB2BIntegration = $EnableAzureADB2BIntegration SourceDocument = "CIS_Microsoft_365_Foundations_Benchmark_v6.0.1" } Error = if ($Pass) { $null } else { "EnableAzureADB2BIntegration 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 } } |