Using c# I would like to create a SharePoint online group and assign a permission to that group. According to this: http://msdn.microsoft.com/en-us/library/fp179912.aspx i am able to create roles, add a user to a sharepoint group etc., but i doesnt explain how to create a sharepoint group.

Can anybody help me?

1 Answer 1


You can Try following code to Create groups:

    Web web = clientContext.Web;   

    GroupCreationInformation groupCreationInfo = new GroupCreationInformation();
    groupCreationInfo.Title = "Custom Group";
    groupCreationInfo.Description="Custom group created using Client Object Model";

    User owner = web.EnsureUser(@"domainName\ownerName");
    User member = web.EnsureUser(@"domainName\userName");

    Group group = web.SiteGroups.Add(groupCreationInfo);
    group.Owner = owner;


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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