A colleague reached out regarding an issue. He had created a Team and applied a sensitivity label to it. Unfortunately, this sensitivity label disabled external sharing. He then went ahead and remvoed the label, but he still couldn’t add external users (even after waiting for a few days).
I took a look at the group and found that sharing to guests is still disabled. This can be done via an EXO cmdlet: Get-UnifiedGroup '<group name>' | fl *Gues*
|
1 |
AllowAddGuests : False |
Turns out the Set-UnifiedGroup cmdlet doesn’t have an option to toggle this. Got to use Graph API for this, specifically the group settings endpoint. Here’s what I did:
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# To get the group Id $groupObj = Get-MgGroup -Filter "DisplayName eq '<group name>'" $groupId = $groupObj.Id # Get the existing settings. Need this for the GroupSettingId. $groupSettingsObj = Get-MgGroupSetting -GroupId $groupId # To allow Guests - body of the request $params = @{ values = @( @{ name = "AllowToAddGuests" value = "True" } ) } Update-MgGroupSetting -GroupId $groupId -BodyParameter $params -GroupSettingId $groupSettingsObj.Id # To view the setting via Graph after the change (Get-MgGroupSetting -GroupId $groupId).Values |
