This is the Trace Id: 7736abdd1460705ab7776b3e7b9d9da7
Skip to main content Microsoft 365 Office Azure Copilot Windows Support Windows Apps OneDrive Outlook Moving from Skype to Teams OneNote Microsoft Teams Accessories Xbox games Microsoft AI Microsoft Security Azure Dynamics 365 Microsoft 365 for business Microsoft Power Platform Windows 365 Digital Sovereignty Microsoft Developer Microsoft Learn Support for AI marketplace apps Microsoft Tech Community Microsoft Marketplace Visual Studio Marketplace Rewards Free downloads & security Education Gift cards View Sitemap

Set Guest Allow Block Domain Policy

Provides way to set, update and remove the allow and deny list of domains for guests in the organization.

Important! Selecting a language below will dynamically change the complete page content to that language.

Download
  • Version:

    1.0

    Date Published:

    15/07/2024

    File Name:

    Set-GuestAllowBlockDomainPolicy.ps1

    File Size:

    21.5 KB

    Helps admin to update the AzureADPolicy for Allow/Block domain list for inviting external Users. Using this script IT Admin can set-up:
    • Allow list, guest users of this domain list can only be invited to O365 Groups.
    • Block list, guest users of this domain list cannot be invited to O365 Groups.
    This policy works independently of SharePoint Online allow/block list.
  • Supported Operating Systems

    Windows 10, Windows Server 2012 R2 Datacenter, Windows Server 2012 R2 Essentials , Windows Server 2012 R2 Preview, Windows Server 2012 R2 Standard , Windows Server 2012 Release Candidate, Windows Server 2012 Standard, Windows Server 2016

    • PowerShell version 2.0 or later.
    • Azure AD Preview 2.0, see here
    • SharePoint Online PowerShell module. Download it from here
  • Perform the following steps:
    1. Download this script and place it in a folder of your choice.
    2. Start Windows PowerShell version 2.0 or later.
    3. Connect to AzureAD. More details here
    4. Connect to SharePoint Online. More details here. This step is necessary if you do plan to import existing allow/block list from SharePoint Online.
    5. Execute Set-GuestAllowBlockDomainPolicy.ps1 with parameters that set, update, import, or remove the allow/block domain list.