pnp / cli-microsoft365

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

Enhance `spo user ensure` with more options #6181

Open milanholemans opened 3 months ago

milanholemans commented 3 months ago

Currently, the command spo user ensure accepts two options: user ID and user UPN. However, there can/should be more options, for example, to ensure Entra groups.

I suggest we add the following options:

Option Description
--loginName [loginName] The login name of the principal. Specify either loginName, entraId, userName, entraGroupId, or entraGroupName.
--entraGroupId [entraGroupId] ID of the Microsoft Entra group. Specify either loginName, entraId, userName, entraGroupId, or entraGroupName.
--entraGroupName [entraGroupName] Display name of the Microsoft Entra group. Specify either loginName, entraId, userName, entraGroupId, or entraGroupName.

Let's also add some extra examples, e.g.:

m365 spo user ensure --webUrl https://contoso.sharepoint.com/sites/Marketing --loginName "c:0t.c|tenant|e08e899f-ba40-4e91-ab36-44d4fbaa454e"
m365 spo user ensure --webUrl https://contoso.sharepoint.com/sites/Marketing --loginName "i:0#.f|membership|john.doe@contoso.com"
m365 spo user ensure --webUrl https://contoso.sharepoint.com/sites/Marketing --entraGroupId e08e899f-ba40-4e91-ab36-44d4fbaa454e
m365 spo user ensure --webUrl https://contoso.sharepoint.com/sites/Marketing --entraGroupId "Marketing team"
nanddeepn commented 1 month ago

Can I work on this?

nanddeepn commented 1 month ago

Can I work on this?

milanholemans commented 1 month ago

Sure, thanks!