Вопрос

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)
    group.update({
        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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с sharepoint.stackexchange
scroll top