Cli-microsoft365: New command: spo user remove

Created on 25 Jun 2020  路  10Comments  路  Source: pnp/cli-microsoft365

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

good first issue new feature pr-merged

Most helpful comment

Hey @dips365 , I updated the spec. Please use spo user remove instead of spo web user remove. Thank you and I am sorry for the disturbance.

All 10 comments

See comments on #1673

Changes made. Thanks!

Hey,

I would like to give my contribution on it.
Feel free to assign me to create a new command to remove user from particular web.

Thanks,
Dips365

Hey @dips365 馃憢馃徎

Thank you for your help, it鈥檚 all yours.

Here is our guide for creating a new command, if you have any questions please do not hesitate to reach out.

https://github.com/pnp/office365-cli/blob/master/docs/guides/adding-command.md

Hey @garrytrinder
Can you please reassigned me ? Mistakenly, i unassigned myself.

Apologies !!

Done. Thank you!

Hey @VelinGeorgiev, @dips365, please have a look at my comments from #1673 and adjust this spec before you start going. Sorry for the trouble 馃槉

@waldekmastykarz @VelinGeorgiev
I read conversations in #1673 & #1672.
I am following below pattern to make new command.

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

thought?

Hey @dips365 , I updated the spec. Please use spo user remove instead of spo web user remove. Thank you and I am sorry for the disturbance.

Thanks @VelinGeorgiev

Was this page helpful?
0 / 5 - 0 ratings