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
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
Usage
m365 entra group add [options]
Description
Creates an Azure AD group
Options
-n, --displayName <displayName>-d, --description [description]-t, --type <type>microsoft365orsecurity.-m, --mailNickname [mailNickname]--ownerIds [ownerIds]ownerIdsorownerUserNames, but not both.--ownerUserNames [ownerUserNames]ownerIdsorownerUserNames, but not both.--memberIds [memberIds]memberIdsormemberUserNames, but not both.--memberUserNames [memberUserNames]memberIdsormemberUserNames, but not both.--visibility [visibility]Private,Public, orHiddenMembership. Defaults toPublic. Specify only when creating a group of typemicrosoft365.Examples
Create a security group without any owners or members
Create a private Microsoft 365 group with owners and members and a custom mail address
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
To validate
mailNickname, consider: This property can contain only characters in the ASCII character set 0 - 127 except the following: @ () \ [] " ; : <> , SPACE.mailNicknameis always a required property. If it's not specified, let's generate one ourselves.Let's allow unknown options: https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0
Let's also add a remark that warns the user that you cannot change the group type when you choose HiddenMembership.
Let's add a remark that explains all group visibilities
API: https://learn.microsoft.com/en-us/graph/api/group-post-groups?view=graph-rest-1.0&tabs=http