pnp / cli-microsoft365

Manage Microsoft 365 and SharePoint Framework projects on any platform
https://aka.ms/cli-m365
MIT License
896 stars 318 forks source link

New command: `entra group set` #5479

Closed milanholemans closed 1 week ago

milanholemans commented 11 months ago

Usage

m365 entra group set [options]

Description

Updates a Microsoft Entra 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 @). Use only for mail-enabled groups. 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 --ownerUserNames "john.doe@contoso.com,adele.vance@contoso.com"

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

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

MartinM85 commented 7 months ago

Can I take it?

Could you please explain a little bit more what do you mean by allow unknown options?

milanholemans commented 7 months ago

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.

MartinM85 commented 6 months ago

@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

milanholemans commented 6 months ago

Great remarks and suggestions @MartinM85, much appreciated!

Do newDisplayName, mailNickname and description represent the properties to be updated?

From what I can remember, yes.