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"
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:
--loginName [loginName]
loginName
,entraId
,userName
,entraGroupId
, orentraGroupName
.--entraGroupId [entraGroupId]
loginName
,entraId
,userName
,entraGroupId
, orentraGroupName
.--entraGroupName [entraGroupName]
loginName
,entraId
,userName
,entraGroupId
, orentraGroupName
.Let's also add some extra examples, e.g.: