Delete Site Group in SharePoint using CSOM

The example in this topic show how to use CSOM to Delete Site Group in SharePoint

  • using Microsoft.SharePoint.Client;
  • using System.Linq;
  •  
  • using (ClientContext clientContext = new ClientContext("http://MyServer/sites/MySiteCollection"))
  • {
  • // Get group object using group name
  • Group oGroup = clientcontext.Web.SiteGroups.GetByName("New Group");
  •  
  • // Load the group
  • clientcontext.Load(oGroup);
  • clientcontext.ExecuteQuery();
  •  
  • // Remove group
  • clientcontext.Web.SiteGroups.Remove(oGroup);
  • clientcontext.ExecuteQuery();
  • }

Thank you for reading this article. This code was tested in SharePoint 2013

We value your feedback:

Page URL:

Name:

 

Email:

 
 

Feedback:

 

© 2019 Code SharePoint