How to restrict guest access to a specific Microsoft 365 group?
+
Block even owners from adding guest users to Microsoft 365 groups!
Your Microsoft 365 environment may have specific groups containing sensitive information that should be only accessed by users within your organization. Since adding guest users to these groups might result in potential data breaches, it is crucial to configure Office 365 guest user limitations.
Run the below PowerShell cmdlet to block guests from being added to a specific Microsoft 365 group:
$GroupName = "<GroupName>"
Connect-AzureAD
$template = Get-AzureADDirectorySettingTemplate | ? {$_.displayname -eq "group.unified.guest"}
$settingsCopy = $template.CreateDirectorySetting()
$settingsCopy["AllowToAddGuests"]=$False
$groupID= (Get-AzureADGroup -SearchString $GroupName).ObjectId
New-AzureADObjectSetting -TargetType Groups -TargetObjectId $groupID -DirectorySetting $settingsCopy
Including guest users in highly confidential groups might be unnecessary as these groups are intended for internal users.
With AdminDroid, you can create an alert when a guest user is added to specific Microsoft 365 groups.
- Follow the below steps to create an Alert by applying the filter for "Group Name" equal <Desired Group’s name>.