Skip to content

New command: spo user remove #1674

@VelinGeorgiev

Description

@VelinGeorgiev

Usage

spo user remove [options]

Description

Removes an site user from specific web

Options

Option Description
-u, --webUrl <webUrl> Url of the web to remove the user from
--id [id] Id of the site user to get
--loginName [loginName] Login name of the site user to get
-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

Notes

Use either 'id' or 'loginName', but not both.

Example

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

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

Removes user with loginName i:0#.f|membership|[email protected] for web https://contoso.sharepoint.com/sites/mysite

spo user remove --webUrl "https://contoso.sharepoint.com/sites/mysite" --loginName "i:0#.f|membership|[email protected]"

Rest APIs reference

DELETE https://contoso.sharepoint.com/_api/web/siteusers/GetById(14)
DELETE https://contoso.sharepoint.com/_api/web/siteusers/RemoveByLoginName('i%3A0%23.f%7Cmembership%7Cvelin.georgiev%tenant.onmicrosoft.com')

Additional Information

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

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions