One way to control invitations to B2B collaboration users from specific organizations is by using an allowlist or blocklist. For instance, if you wish to prevent invitations from personal email addresses, you could create a blocklist containing domains such as Gmail.com and Outlook.com. Alternatively, if your business only wants to invite partner organizations such as Contoso.com, Fabrikam.com, and Litware.com, you can add them to your allowlist to limit invitations to only these organizations.
However, there are a few points to keep in mind before allowing/dis-allowing domains for communications as listed below:
Here’s a PowerShell script that you can use to check if the collaboration invitations are sent to only allowed domains. The result returned from the script is stored in a CSV file. Please ensure to install required PowerShell modules before executing below PowerShell script.
$Error.Clear() $ModProcess = "Yes" $TotNo = "" IF ($ModProcess -eq "Yes") { $TestCSVFile = "C:\Temp\B2BDomains.CSV" $STR = "Name,Status" Add-Content $TestCSVFile $STR $TotLicensed = 0 $TotNotLicensed = 0 $AnyGap = "No" $TestStatus = "" $SumVal = "" $TestText = "" $log = @() #List all B2B domains based on the condition $policy = (Get-AzureADPolicy | ? { $_.DisplayName -eq "B2BManagementPolicy" } | select definition) #replace single quote with escape charcter and double quotes if ($policy) { $defs = $policy.Definition.Replace('"', "\""""") $allowedDomains = $defs.Substring($defs.indexof("[") + 1) $allowedDomains = $allowedDomains.Substring(0, $allowedDomains.IndexOf("]")) #revert back the quotes back to normal node to see the real output $alloweddomain = $allowedDomains.Replace("\""""", "") if ($alloweddomain) { $value = "Yes" $AnyGap = "Yes" $TotNo = "Enabled" $ourobject = New-Object -TypeName PSObject $ourobject | Add-Member -MemberType NoteProperty -Name PolicyName -Value "B2BManagementPolicy" -Force $ourobject | Add-Member -MemberType NoteProperty -Name CollInvitationstoallowedDomains -Value $value -Force $STR = "B2BManagementPolicy," + $value Add-Content $TestCSVFile $STR } else { $value = "No" $ourobject = New-Object -TypeName PSObject $ourobject | Add-Member -MemberType NoteProperty -Name PolicyName -Value "B2BManagementPolicy" -Force $ourobject | Add-Member -MemberType NoteProperty -Name CollInvitationstoallowedDomainsOnly -Value $value $TotNo = "Disabled" $STR = "B2BManagementPolicy," + $value Add-Content $TestCSVFile $STR } $log += $ourobject } else { $ourobject = New-Object -TypeName PSObject $ourobject | Add-Member -MemberType NoteProperty -Name PolicyName -Value "No Policy Configured for B2B Collaboration" -Force $ourobject | Add-Member -MemberType NoteProperty -Name CollInvitationstoallowedDomainsOnly -Value "Not Applicable" $log += $ourobject $AnyGap = "Yes" $TotNo = "Enabled-No Policy Configured" $STR = "B2BManagementPolicy," + "Not Configured" Add-Content $TestCSVFile $STR } }
SmartProfiler is a tool that has been specifically developed to support CIS Standards for Office 365 Foundation (M365) and Microsoft Azure. It is worth noting that SmartProfiler provides a more comprehensive set of tests than the CIS Benchmark for Office 365 Foundation, offering a total of 138 tests across all relevant categories. While the CIS benchmark provides only 87 tests, SmartProfiler’s additional 51 tests are specifically designed by DynamicPacks Technologies Office 365 team to ensure that every aspect of Office 365 is covered.
As an experienced provider of Office 365 services, we have worked with clients across the globe to develop tests that address Office 365 misconfigurations and other common issues. With SmartProfiler, our clients can rest assured that they are receiving the most comprehensive suite of tests available for Office 365 environments.
The PowerShell script provided as part of this article is also included in SmartProfiler for Office 365 Assessment Tool.