Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more options to spo user remove. closes #5522 #5806

Closed
wants to merge 25 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
8feea8b
more options to spo user remove
reshmee011 Jan 30, 2024
0d02e90
Update src/m365/spo/commands/user/user-remove.ts
reshmee011 Feb 12, 2024
2e987b2
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Feb 12, 2024
ccf9e57
Update src/m365/spo/commands/user/user-remove.spec.ts
reshmee011 Feb 12, 2024
09a9177
Update src/m365/spo/commands/user/user-remove.spec.ts
reshmee011 Feb 12, 2024
2529f2d
updates made based in feedback from Adam
reshmee011 Feb 13, 2024
d10e071
Merge branch 'pnp:main' into sporemoveoptions
reshmee011 Feb 13, 2024
a7f0d8c
update to entra id
reshmee011 Feb 13, 2024
ac135c0
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 2, 2024
5fb5027
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 2, 2024
4549290
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 2, 2024
06aa729
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 2, 2024
13ed301
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 2, 2024
0dac710
Update src/m365/spo/commands/user/user-remove.ts
reshmee011 Mar 2, 2024
886511c
Update src/m365/spo/commands/user/user-remove.spec.ts
reshmee011 Mar 2, 2024
088851c
Update src/m365/spo/commands/user/user-remove.ts
reshmee011 Mar 2, 2024
e90123b
Merge branch 'pnp:main' into sporemoveoptions
reshmee011 Mar 2, 2024
b36316a
Updated changes based on feedback
reshmee011 Mar 2, 2024
25a4d56
updates
reshmee011 Mar 2, 2024
f991de6
undo the commanderror as unable to get the test case to work
reshmee011 Mar 8, 2024
93f7e3d
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 8, 2024
760cc44
Update src/m365/spo/commands/user/user-remove.spec.ts
reshmee011 Mar 8, 2024
570aa07
Update docs/docs/cmd/spo/user/user-remove.mdx
reshmee011 Mar 8, 2024
fc6b91d
Update src/m365/spo/commands/user/user-remove.ts
reshmee011 Mar 8, 2024
e91e31e
updates
reshmee011 Mar 8, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 40 additions & 9 deletions docs/docs/cmd/spo/user/user-remove.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,38 +14,69 @@ m365 spo user remove [options]

```md definition-list
`-u, --webUrl <webUrl>`
: URL of the web to remove user
: URL of the web to remove user. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
: URL of the web to remove user. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.
: URL of the web to remove user.


`--id [id]`
: ID of the user to remove from web
: ID of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`--loginName [loginName]`
: Login name of the site user to remove
: Login name of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`--userName [userName]`
: User name of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`--email [email]`
: Email of the user to remove from web. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`--entraGroupId [entraGroupId]`
: Object ID of the Entra group ID to remove. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`--entraGroupName [entraGroupName]`
: Name of the Entra group to remove. Use either `id` or `loginName` or `email`, `userName`, `entraGroupId`, or `entraGroupName`, but not all.

`-f, --force`
: Do not prompt for confirmation before removing user from web
```

<Global />

## Remarks

Use either `id` or `loginName`, but not both

## Examples

Removes user with id _10_ from a web without prompting for confirmation
Removes user by id from a web without prompting for confirmation

```sh
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --id 10 --force
```

Removes user with login name _i:0#.f|membership|[email protected]_ from a web
Removes user by loginName from a web

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

Removes user by userName from a web

```sh
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --userName "john.doe_hotmail.com#ext#@mytenant.onmicrosoft.com"
```

Removes user by email from a web

```sh
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --email "[email protected]"
```

Removes user by entraGroupId from a web

```sh
m365 spo user remove --webUrl "https://contoso.sharepoint.com/sites/HR" --entraGroupId f832a493-de73-4fef-87ed-8c6fffd91be6
```

Removes user by entraGroupName from a web

```sh
m365 spo user remove --webUrl _https://contoso.sharepoint.com/sites/HR_ --entraGroupName "Test Members"
```
## Response

The command won't return a response on success.
Expand Down
Loading
Loading