0

I have an problem with adding existing Azure AD groups to SharePoint online. What am I trying to do, I’m creating 50+ sites and break the site inheritance. then I like to add existing AzureAD groups to the SharePoint online site

there are a lot of sites that explaine how to create a new group and add that to the site and how to add users to a group but I haven’t found an site that explains how to add an existing group to a site.

I looked at this site but this is adding users to an group Add AD group to SharePoint Online using REST API

the title of the site sounded good

I know how to do this on-prem but in the cloud there is where i have a problem

Hope someone knows the answer

  • do these groups have email address ? do you want to add the Azure AD group to a SharePoint group ? – Gautam Sheth Mar 27 '18 at 12:10
  • I like to add an Azure AD group to an site, not to an SharePoint group if i add an Azure AD group to an Sharepoint group than I have two groups for the same site. if possible I want to skip the Sharepoint group – Robert1972 Mar 28 '18 at 6:26
1

We did the following when adding AD groups via C#:

var group = ctx.Web.EnsureUser($"c:0t.c|tenant|{groupid}");
item.RoleAssignments.Add(group, new RoleDefinitionBindingCollection(ctx) {contribute});

Where groupid was the object identifier of the AD group. If you import the SharePoint Client libraries to PowerShell, you should be able to refactor this so that you can use it.

  • I don't get this to work I added these two files to the powershell script but no luck Add-Type -Path "C:\~\Microsoft.SharePoint.Client.dll" Add-Type -Path "C:\~\Microsoft.SharePoint.Client.Runtime.dll" also I have to say that my C# knowledge is not that great, PowerShell is a lot better – Robert1972 Apr 11 '18 at 6:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.