pnp / pnp/cli-microsoft365

Provide CRUD operations for site collection administrators?

Open
#4,173 6 comments 4 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

needs design new feature
Dominant language
TypeScript
Stars
1.5k
Forks
413
Avg merge
5d 6h
Merged PRs (30d)
21

Description

Hello,
this is a suggestion of a command that might be useful for manipulating SharePoint site collection administrators. I haven't found a way to add and remove site collection admins from a dedicated set of commands in the CLI.

Administrators can be added/demoted from the site collection admin list by using this pseudo code.

var body = new
{
    __metadata = new
    {
        type = "SP.User"
    },
    IsSiteAdmin = false
};
var user = await context.Web.EnsureUserAsync(adminUserPrincipalName);
var adminRequest = new ApiRequest(new HttpMethod("MERGE"), ApiRequestType.SPORest, $"/_api/web/getuserbyid({user.Id})", JsonSerializer.Serialize(body));

I leave it open to the team to decide if this use case is interesting enough and how to design an existing set of commands or create new ones.

Cheers

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the CLI's existing command patterns for SharePoint users and site administration, then examine the SharePoint REST request shown in the issue. Define whether this belongs in an existing command set or requires new commands, with completion meaning administrators can be added and removed through the CLI.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.