New command: `entra group set`
Usage
m365 entra group set [options]
Description
Updates a Microsoft Entra ID group
Options
| Option | Description |
|---|---|
-i, --id [id] |
The ID of the Microsoft Entra ID group to update. Specify either id or displayName but not both. |
-n, --displayName [displayName] |
The display name of the Microsoft Entra ID group to update. Specify either id or displayName but not both. |
--newDisplayName [newDisplayName] |
The new display name of the Microsoft Entra ID group. The maximum length is 256 characters. |
--description [description] |
The description for the group. |
--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. |
--ownerUserNames [ownerUserNames] |
Comma-separated list of UPNs of Microsoft Entra ID users that will be group owners. |
--memberIds [memberIds] |
Comma-separated list of IDs of Microsoft Entra ID users that will be group members. |
--memberUserNames [memberUserNames] |
Comma-separated list of UPNs of Microsoft Entra ID users that will be group members. |
--visibility [visibility] |
Specifies the group join policy and group content visibility for Microsoft 365 groups. Possible values are: Private or Public. Specify only when targeting a Microsoft 365 group. |
Examples
Update the display name of a group specified by the display name
m365 entra group set --displayName Developers --newDisplayName Developers
Set the owners of a group to the specified people
m365 entra group set --id 57fd6b33-54eb-42b0-9ea0-8a9ac04eab7d --owners "[email protected],[email protected]"
Update the description and mail nickname of a group
m365 entra group set --id 57fd6b33-54eb-42b0-9ea0-8a9ac04eab7d --description "All developers of the company" --mailNickname developers
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. - Let's allow unknown options: https://learn.microsoft.com/en-us/graph/api/resources/group?view=graph-rest-1.0#properties
API: https://learn.microsoft.com/en-us/graph/api/group-update?view=graph-rest-1.0&tabs=http
Can I take it?
Could you please explain a little bit more what do you mean by allow unknown options?
Sure @MartinM85!
What we mean by allowing unknown options is the following: usually we specify a list of options a user can use and throw an error if people specify an option that is not in the list. By allowing unknown options, users can specify other options that we didn't provide. This way they can specify any graph group option that we didn't specify. Important here is that we show the graph docs link in our docs so people know what properties they can specify.
You can have a look at entra user add, entra user set commands for inspiration.
@milanholemans maybe wrong descriptions for id and displayName options.
The ID of the Azure AD group to update. Specify either id or mailNickname but not both
Do newDisplayName, mailNickname and description represent the properties to be updated?
Similar to entra group add command, I would suggest to split owners, members ->ownerIds, ownerUserNames, membersIds, membersUserNames
Great remarks and suggestions @MartinM85, much appreciated!
Do
newDisplayName,mailNicknameanddescriptionrepresent the properties to be updated?
From what I can remember, yes.