I'm trying to update the Owner of a SP Group. This is what I've tried:

import pnp from "pnp";

let newgroup = {};
pnp.sp.web.siteGroups.getByName("BA_Actuarial").get().then(function(g) {
    newgroup = g

let group  = pnp.sp.web.siteGroups.getByName("BA_SargonTest").expand("owner")

group.get().then(data => {
    console.log(data, newgroup)
        Owner: newgroup

This is currently not possible using REST API's itself. So, using PnP JS core also, it wont be possible, as its a wrapper of SP REST APIs.

User voice - Add the possibility to set the Owner when creating a SharePoint Group using REST API

Mark Anderson's blog - Capture missing SP REST API endpoints

Workaround using the old _vti_bin/client.svc looks like possible (haven't tested).

Set group owner using REST API

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.