Skip to content

New command: spo group remove #1693

@VelinGeorgiev

Description

@VelinGeorgiev

Usage

spo group remove [options]

Description

Removes site group from specific web

Options

Option Description
-u, --webUrl <webUrl> Url of the web to remove the group from
--id [id] Id of the site group to remove
--name [name] Name of the site group to remove
-o, --output [output] Output type. json,text. Default text
--verbose Runs command with verbose logging
--debug Runs command with debug logging
--confirm Confirm removal of user from site

Remarks

Use either 'id' or 'name', but not both

Example

Removes group with id 5 for web https://contoso.sharepoint.com/sites/mysite

spo group remove --webUrl "https://contoso.sharepoint.com/sites/mysite" --id 5

Removes group with name Team Site Owners for web https://contoso.sharepoint.com/sites/mysite

spo group remove --webUrl "https://contoso.sharepoint.com/sites/mysite" --name "Team Site Owners"

Rest APIs reference

In the case of remove by id, just a single query will delete the group

POST https://contoso.sharepoint.com/_api/web/sitegroups/RemoveById(7)

In the case of remove by name, two queries have to be executed. The first query would find the group id from the group name and the second query will use the id to delete it

GET https://contoso.sharepoint.com/sites/mysite/_api/web/sitegroups/GetByName('Team Site Members')
POST https://contoso.sharepoint.com/_api/web/sitegroups/RemoveById(7)

Additional Information

Remove-PnPGroup -
https://docs.microsoft.com/en-us/powershell/module/sharepoint-pnp/remove-pnpgroup?view=sharepoint-ps

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions