Skip to content

Commit

Permalink
Enhances 'entra m365group user remove' command. Closes pnp#6058
Browse files Browse the repository at this point in the history
  • Loading branch information
MathijsVerbeeck authored and Adam-it committed Oct 16, 2024
1 parent d03ed9d commit 3ba7738
Show file tree
Hide file tree
Showing 3 changed files with 295 additions and 349 deletions.
36 changes: 27 additions & 9 deletions docs/docs/cmd/entra/m365group/m365group-user-remove.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,25 @@ m365 entra m365group user remove [options]

```md definition-list
`-i, --groupId [groupId]`
: The ID of the Microsoft 365 Group from which to remove the user.
: The ID of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.

`--groupName [groupName]`
: The display name of the Microsoft 365 group. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`..

`--teamId [teamId]`
: The ID of the Microsoft Teams team from which to remove the user.
: The ID of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.

`--teamName [teamName]`
: The display name of the Microsoft Teams team. Specify only one of the following: `groupId`, `groupName`, `teamId`, or `teamName`.

`-n, --userName [userName]`
: (deprecated) User's UPN (user principal name), eg. `[email protected]`.. Specify only one of the following: `userName`, `ids` or `userNames`.

`--ids [ids]`
: Microsoft Entra IDs of users. You can also pass a comma-separated list of IDs. Specify only one of the following `userName`, `ids` or `userNames`.

`-n, --userName <userName>`
: User's UPN (user principal name), eg. `[email protected]`.
`--userNames [userNames]`
: The user principal names of users. You can also pass a comma-separated list of UPNs. Specify only one of the following `userName`, `ids` or `userNames`.

`-f, --force`
: Don't prompt for confirming removing the user from the specified Microsoft 365 Group or Microsoft Teams team.
Expand All @@ -37,19 +49,25 @@ You can remove users from a Microsoft 365 Group or Microsoft Teams team if you a
Removes user from the specified Microsoft 365 Group.

```sh
m365 entra m365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName '[email protected]'
m365 entra m365group user remove --groupId '5b8e4cb1-ea40-484b-a94e-02a4313fefb4' --userNames '[email protected]'
```

Removes user from the specified Microsoft 365 Team specified by id without confirmation.

```sh
m365 entra m365group user remove --teamId '5b8e4cb1-ea40-484b-a94e-02a4313fefb4' --userNames '[email protected]' --force
```

Removes user from the specified Microsoft 365 Group without confirmation.
Removes users specified by a comma separated list of user principal names from the specified Microsoft Teams team specified by name

```sh
m365 entra m365group user remove --groupId '00000000-0000-0000-0000-000000000000' --userName '[email protected]' --force
m365 entra m365group user remove --teamName 'Project Team' --userNames '[email protected],[email protected]'
```

Removes user from the specified Microsoft Teams team.
Removes users specified by a comma separated list of user ids from the specified Microsoft 365 group specified by name.

```sh
m365 entra teams user remove --teamId '00000000-0000-0000-0000-000000000000' --userName '[email protected]'
m365 entra m365group user remove --groupName 'Project Team' --ids '5b8e4cb1-ea40-484b-a94e-02a4313fefb4,be7a56d8-b045-4938-af35-917ab6e5309f'
```

## Response
Expand Down
Loading

0 comments on commit 3ba7738

Please sign in to comment.