It is challenging to add the Office 365 Cloud security groups of format – xxxx.onmicrosoft.com, to a SharePoint sites as they are not found through AD so SharePoint cannot find them through the UPN or Domain\GroupName.

In order to add these cloud security groups, we have to go through a workaround to get the unique role manager ID of format below and then add it to SharePoint through PowerShell

c:0-.f|rolemanager|s-X-X-XX-XXXXXX-XXXXXX-XXXX-XXXXXXX.

In order to get the unique role manager ID follow the below steps:

  1. Open a SharePoint Site
  2. Go to Site Permissions
  3. Add the Office 365 Cloud security group (xxxx.onmicrosoft.com) to SharePoint Site Permissions
  4. Click on the added group to get to the User Information page
  5. Copy the role manager ID in the above format from the account column

After you have got the role manager ID, now you can add it through PnP PowerShell using the security cmdlets. The cmdlet might vary based on which location and how you are trying to add this cloud group.

Hence, by above we can add Office 365 cloud security groups to SharePoint also.

Happy coding !!

 

Leave a comment