Add an AD Group to a Sharepoint 2010 list using the Client Object Model

Asked

Viewed 40 times

1

Does anyone know how to add an existing AD group to a Sharepoint 2010 list?

So far I’ve only seen how to add a Sharepoint group, but I need to add an AD group.

using (var ctx = new SharepointClient.ClientContext(sharepointSiteUrl))
{
 var groupCreationInfo = new Microsoft.SharePoint.Client.GroupCreationInformation
 {
    Title = "Nome do Grupo",
    Description = "Descrição do grupo"
 };

 var groupOwner = ctx.Web.SiteGroups.GetByName("GrupoSharepoint"); 
 var group = ctx.Web.SiteGroups.Add(groupCreationInfo);
 group.Owner = groupOwner;
 group.Update();
 ctx.ExecuteQuery();
}
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.