Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I want to remove custom security group from sharepoint 2010. I created custom security group as follows:

SPGroup wcmGroup = currentWeb.SiteGroups[permissionName];
SPRoleDefinition customRoleDefinition = currentWeb.RoleDefinitions[permissionName];
SPRoleAssignment roleAssignment = new SPRoleAssignment(wcmGroup);
roleAssignment.RoleDefinitionBindings.Add(customRoleDefinition);
currentWeb.RoleAssignments.Add(roleAssignment);
wcmGroup.Update();
currentWeb.Update();

However, I don't know how to remove the groups. Thanks.,

share|improve this question

2 Answers 2

up vote 1 down vote accepted
currentWeb.SiteGroups.RemoveByID(wcmGroup.ID);
share|improve this answer
    
Thanks a lot. It worked like a charm. –  Sanghoon Nov 29 '12 at 20:16

Did you try this...

Delete a security group

In the header, click Admin.

In the left pane, under Management, click Security Groups.

On the Security groups page, select the check box next to the group that you want to delete,

and then click Delete.

Important: You cannot delete a group synchronized with your Active Directory service. To delete the group, use your local Active Directory management tools.

A dialog box appears asking if you are sure that you want to delete the group. After you click Yes, the dialog will show the deletion in process. Click Close when deletion is complete.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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