If you want to create a group and add the default group owner and user, you can use the following codes:
string siteUrl = "https://server/sites/sitename"; ClientContext clientContext = new ClientContext(siteUrl); Web web = clientContext.Web; GroupCreationInformation groupCreationInfo = new GroupCreationInformation(); groupCreationInfo.Title = "Custom Group"; groupCreationInfo.Description = "description ..."; User owner = web.EnsureUser(@"domain\username1"); User member = web.EnsureUser(@"domain\username2"); Group group = web.SiteGroups.Add(groupCreationInfo); group.Owner = owner; group.Users.AddUser(member); group.Update(); clientContext.ExecuteQuery();
My question is: I know how to add a user as the owner of the group, but if I want to add the SharePoint Technical Support group as the owner of the group, what should be the code?
source share