Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New command: m365 spo site admin remove #5884

Open
Tracked by #5874
MathijsVerbeeck opened this issue Mar 5, 2024 · 6 comments · May be fixed by #6062
Open
Tracked by #5874

New command: m365 spo site admin remove #5884

MathijsVerbeeck opened this issue Mar 5, 2024 · 6 comments · May be fixed by #6062

Comments

@MathijsVerbeeck
Copy link
Contributor

MathijsVerbeeck commented Mar 5, 2024

Usage

m365 spo site admin remove [options]

Description

Removes a user or group as site collection administrator

Options

Option Description
-u, --siteUrl <siteUrl> The URL of the site
--userId [userId] The ID of the user to remove as a site collection admin
--userName [userName] The user principal name of the user to remove as a site collection admin
--groupId [groupId] The ID of the Microsoft Entra ID group to remove as a site collection admin
--groupName [groupName] The name of the Microsoft Entra ID group to remove as a site collection admin
--asAdmin If specified, we will use the SharePoint admin center to execute the command
-f, --force Don't prompt for confirmation

Examples

Removes user as site collection admin

m365 spo site admin remove --siteUrl https://contoso.sharepoint.com --userId 600713c5-53c6-4f24-b454-3c35e22b2639

Removes group as site collection admin without prompting for confirmation

m365 spo site admin remove --siteUrl https://contoso.sharepoint.com --groupName SP_Administrators --force

Response

No response

Additional info

We should add correct error handling as when we try to remove the primary site collection admin or when we try to remove the final site collection admin, as there always has to be atleast one if I'm not mistaken

@martinlingstuyl
Copy link
Contributor

Also check out my comment here: #5882 (comment)

@MathijsVerbeeck
Copy link
Contributor Author

@martinlingstuyl I have updated the specs to include the --asAdmin flag.

@martinlingstuyl
Copy link
Contributor

Should we use a -a short?

@MathijsVerbeeck
Copy link
Contributor Author

Should we use a -a short?

We could, but it would be quite inconsistent as we do not use this short with the Power Platform commands that we offer.

@Adam-it
Copy link
Contributor

Adam-it commented Mar 6, 2024

LGTM 👍

@mkm17
Copy link
Contributor

mkm17 commented May 8, 2024

Hi, could you assign me to this task as it is similar to other m365 spo site admin ... commands :)

@Adam-it Adam-it added work in progress and removed needs peer review Needs second pair of eyes to review the spec or PR labels May 9, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue May 20, 2024
mkm17 added a commit to mkm17/cli-microsoft365 that referenced this issue May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants