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 add #5476

Closed
Tracked by #5432
milanholemans opened this issue Sep 11, 2023 · 6 comments
Closed
Tracked by #5432

New command: entra group add #5476

milanholemans opened this issue Sep 11, 2023 · 6 comments

Comments

@milanholemans
Copy link
Contributor

milanholemans commented Sep 11, 2023

Usage

m365 entra group add [options]

Description

Creates an Azure AD group

Options

Option Description
-n, --displayName <displayName> The name for the group. The maximum length is 256 characters.
-d, --description [description] The description for the group.
-t, --type <type> The group type. Valid values: microsoft365 or security.
-m, --mailNickname [mailNickname] The mail alias for the group (part before the @). Maximum length is 64 characters.
--ownerIds [ownerIds] Comma-separated list of IDs of Microsoft Entra ID users that will be group owners. Specify either ownerIds or ownerUserNames, but not both.
--ownerUserNames [ownerUserNames] Comma-separated list of UPNs of Microsoft Entra ID users that will be group owners. Specify either ownerIds or ownerUserNames, but not both.
--memberIds [memberIds] Comma-separated list of IDs of Microsoft Entra ID users that will be group members. Specify either memberIds or memberUserNames, but not both.
--memberUserNames [memberUserNames] Comma-separated list of UPNs of Microsoft Entra ID users that will be group members. Specify either memberIds or memberUserNames, but not both.
--visibility [visibility] Specifies the group join policy and group content visibility for Microsoft 365 groups. Possible values are: Private, Public, or HiddenMembership. Defaults to Public. Specify only when creating a group of type microsoft365.

Examples

Create a security group without any owners or members

m365 entra group add --displayName Developers --type security

Create a private Microsoft 365 group with owners and members and a custom mail address

m365 entra group add --displayName Developers --type microsoft365--mailNickname devs --owners john.doe@contoso.com --members "john.doe@contoso.com,adele.vance@contoso.com" --visibility Private

Create a public Microsoft 365 group without any owners or members

m365 entra group add --displayName Developers --type microsoft365 --description "This group is for all developers in the company."

Default properties

No response

Additional Info

API: https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http

@milanholemans milanholemans added new feature needs peer review Needs second pair of eyes to review the spec or PR labels Sep 11, 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 add New command: entra group add Dec 31, 2023
@MartinM85
Copy link
Contributor

Can I take it?

@Adam-it
Copy link
Contributor

Adam-it commented Jan 8, 2024

Sure 👍

@MartinM85
Copy link
Contributor

@milanholemans Based on this, distribution and mailEnabledSecurity groups cannot be created via Graph API.

Graph API returns the error Cannot Create a mail-enabled security groups and or distribution list. in both cases.

@milanholemans
Copy link
Contributor Author

That's sad, thank you for the feedback. I'll update the spec.

@milanholemans
Copy link
Contributor Author

@MartinM85 made a mall change, changed members to memberIds and memberUserNames. Same with owners.

@MartinM85
Copy link
Contributor

@milanholemans I see that some validation/user utils are already part of PR #5759. Probably the code for adding owners/members will be very similar.

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.

4 participants