0

I am trying to add a SharePoint Group as a Group Owner to another SharePoint Group using CSOM but unfortunately I am not successful. Please find my script below. Can someone please suggest where I might be going wrong?

$var="Project Owners";
        $groupOwner = $ctx.Web.SiteGroups[$var]
        $ctx.Load($groupOwner)
        $OneNoteGroup.Owner = $groupOwner
        $ctx.ExecuteQuery()
1

try this one

using (var ctx = new ClientContext(webUri))
{
    ctx.Credentials = credentials;

    var groupCreationInfo = new GroupCreationInformation
    {
         Title = groupName,
         Description = groupDesc
    };

    var groupOwner = ctx.Web.SiteGroups.GetByName("Tech Support"); //get an existing group

    var group = ctx.Web.SiteGroups.Add(groupCreationInfo);
    group.Owner = groupOwner;
    group.Update();
    ctx.ExecuteQuery();     
}

https://stackoverflow.com/questions/25653909/how-to-add-a-sharepoint-group-as-group-owner-with-client-object-model

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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