Skip to content

Enhance spo user ensure with more options #6181

@milanholemans

Description

@milanholemans

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|[email protected]"
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 --entraGroupName "Marketing team"

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions