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

New command: entra group member remove #5472

Open
Tracked by #5432
milanholemans opened this issue Sep 8, 2023 · 3 comments · May be fixed by #5844
Open
Tracked by #5432

New command: entra group member remove #5472

milanholemans opened this issue Sep 8, 2023 · 3 comments · May be fixed by #5844

Comments

@milanholemans
Copy link
Contributor

milanholemans commented Sep 8, 2023

Usage

m365 entra group member remove [options]

Description

Removes members from a Microsoft Entra group

Options

Option Description
-i, --groupId [groupId] The ID of the Azure AD group. Specify groupId or groupDisplayName but not both.
-n, --groupDisplayName [groupDisplayName] The display name of the Azure AD group. Specify groupId or groupDisplayName but not both.
--ids [ids] Azure AD 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 new user. Valid values: Owner, Member. Defaults to both.
-f, --force Don't prompt for confirmation.

Examples

Remove a single user specified by ID as a member from a group specified by display name

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

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

m365 entra group member remove --groupDisplayName Developers --userNames [email protected] --role Owner

Removes multiple users specified by UPN from a group specified by ID

m365 entra group member remove --groupId a03c0c35-ef9a-419b-8cab-f89e0a8d2d2a --userNames "[email protected],[email protected]"

Default properties

No response

Additional Info

Let's use Graph batching.

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Sep 8, 2023
@Jwaegebaert Jwaegebaert added help wanted and removed needs peer review Needs second pair of eyes to review the spec or PR labels Sep 12, 2023
@Adam-it Adam-it added the hacktoberfest Issue perfect for hacktoberfest label Sep 25, 2023
@milanholemans milanholemans removed the hacktoberfest Issue perfect for hacktoberfest label Nov 6, 2023
@milanholemans milanholemans changed the title New command: aad group user remove New command: entra group user remove Dec 31, 2023
@milanholemans milanholemans self-assigned this Jan 5, 2024
@milanholemans
Copy link
Contributor Author

@pnp/cli-for-microsoft-365-maintainers, currently if a user is a member of a group and you run this command without the role option, you get an error because it tries to remove the user both from the owner and member part of the group.

Would it make sense if we add an extra flag --supressNotFound where people can choose to ignore not found errors?
In my opinion, this would increase user-friendliness. Imagine you want to remove 3 users from a group. One is owner, one is member, and one is owner + member. This means that you will have to run the command 2 times with 2 different values. If we suppress not found errors, the user would be able to do this in one go.

milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Feb 11, 2024
@Jwaegebaert
Copy link
Contributor

That would indeed make it even more user-friendly. That option sounds good to me but we should make sure that the explanation is clear enough for the end-users, either in the option description itself or in a well-written remark regarding the usage of that option.

milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Feb 13, 2024
@milanholemans milanholemans linked a pull request Feb 13, 2024 that will close this issue
@Adam-it
Copy link
Member

Adam-it commented Feb 18, 2024

That would indeed make it even more user-friendly. That option sounds good to me but we should make sure that the explanation is clear enough for the end-users, either in the option description itself or in a well-written remark regarding the usage of that option.

+1

milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Feb 28, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Apr 29, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue May 20, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Aug 5, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Sep 28, 2024
@milanholemans milanholemans changed the title New command: entra group user remove New command: entra group member remove Sep 28, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Oct 19, 2024
milanholemans added a commit to milanholemans/cli-microsoft365 that referenced this issue Jan 3, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants