-
Notifications
You must be signed in to change notification settings - Fork 327
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds 'entra group member remove' command. Closes #5472
- Loading branch information
1 parent
a781c51
commit 27a2dc4
Showing
7 changed files
with
684 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import Global from '/docs/cmd/_global.mdx'; | ||
|
||
# entra group member remove | ||
|
||
Removes members from a Microsoft Entra group | ||
|
||
## Usage | ||
|
||
```sh | ||
m365 entra group member remove [options] | ||
``` | ||
|
||
## Options | ||
|
||
```md definition-list | ||
`-i, --groupId [groupId]` | ||
: The ID of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both. | ||
|
||
`-n, --groupDisplayName [groupDisplayName]` | ||
: The display name of the Entra ID group. Specify `groupId` or `groupDisplayName` but not both. | ||
|
||
`--ids [ids]` | ||
: Entra ID IDs of users. You can also pass a comma-separated list of IDs. Specify either `ids` or `userNames` but not both. | ||
|
||
`--userNames [userNames]` | ||
: The user principal names of users. You can also pass a comma-separated list of UPNs. Specify either `ids` or `userNames` but not both. | ||
|
||
`-r, --role [role]` | ||
: The role to be removed from the users. Valid values: `Owner`, `Member`. Defaults to both. | ||
|
||
`--suppressNotFound` | ||
: Suppress errors when a user was not found in a group. | ||
|
||
`-f, --force` | ||
: Don't prompt for confirmation. | ||
``` | ||
|
||
<Global /> | ||
|
||
## Remarks | ||
|
||
:::tip | ||
|
||
When you use the `suppressNotFound` option, the command will not return an error if a user is not found as either an owner or a member of the group. | ||
This feature proves useful when you need to remove a user from a group, but you are uncertain whether the user holds the role of a member or an owner within that group. | ||
Without using this option, you would need to manually verify the user's role in the group before proceeding with removal. | ||
|
||
::: | ||
|
||
## Examples | ||
|
||
Remove a single user specified by ID as member from a group specified by display name | ||
|
||
```sh | ||
m365 entra group member remove --groupDisplayName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --role Member | ||
``` | ||
|
||
Remove multiple users specified by ID from a group specified by ID | ||
|
||
```sh | ||
m365 entra group member remove --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --ids "098b9f52-f48c-4401-819f-29c33794c3f5,f1e06e31-3abf-4746-83c2-1513d71f38b8" | ||
``` | ||
|
||
Remove a single user specified by UPN as an owner from a group specified by display name | ||
|
||
```sh | ||
m365 entra group member remove --groupDisplayName Developers --userNames [email protected] --role Owner | ||
``` | ||
|
||
Remove multiple users specified by UPN from a group specified by ID | ||
|
||
```sh | ||
m365 entra group member remove --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userNames "[email protected],[email protected]" | ||
``` | ||
|
||
Remove a single user specified by ID as owner and member of the group and suppress errors when the user was not found as owner or member | ||
|
||
```sh | ||
m365 entra group member remove --groupDisplayName Developers --ids 098b9f52-f48c-4401-819f-29c33794c3f5 --suppressNotFound | ||
``` | ||
|
||
## Response | ||
|
||
The command won't return a response on success. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.