Open MathijsVerbeeck opened 4 months ago
I really love these command-specs @mathijsverbeeck! That will be really helpful.
I think it would be important with this set of commands that it should be possible to execute them if you are a SharePoint administrator and not yourself a site collection admin or owner of the site in question.
So, you'd need to be able to add yourself or others as an admin, even if you're currently not.
I think it would be important with this set of commands that it should be possible to execute them if you are a SharePoint administrator and not yourself a site collection admin or owner of the site in question.
So, you'd need to be able to add yourself or others as an admin, even if you're currently not.
I agree, and I think that we could add an option --asAdmin
that we could use when we run in a delegated context, so that we make sure that we use the admin center for adding the site collection administrator. What do you think about this?
I agree, and I think that we could add an option
--asAdmin
that we could use when we run in a delegated context, so that we make sure that we use the admin center for adding the site collection administrator. What do you think about this?
I like that!. Also check out my other comment here: https://github.com/pnp/cli-microsoft365/issues/5882#issuecomment-1981160284
@martinlingstuyl I have updated the specs to include the --asAdmin
flag.
LGTM 👍👏
Hi, could you assign me to this task?
Hi everyone,
I have a quick question about setting a --primary
site collection admin without using --asAdmin mode. I found a method to do this with the _vti_bin/client.svc/ProcessQuery
endpoint, but when I run it, the previous primary site collection admin is removed. I have checked the behavior of PnP.PowerShell, and the effect is the same. I have also tried using the _api/site/owner
endpoint, but it does not give any results. In --asAdmin
mode, I have managed it, and it works correctly.
What do you suggest? Is it better to leave it with the removal behavior and include information about this in the parameter description?
Or perhaps it is better to get the previous primary site collection admin beforehand, set the primary admin (which would remove the previous admin), and then reassign the previous admin as secondary site collection admin?
Usage
m365 spo site admin add [options]
Description
Adds a user or group as a site collection administrator
Options
-u, --siteUrl <siteUrl>
--userId [userId]
--userName [userName]
--groupId [groupId]
--groupName [groupName]
--primary
--asAdmin
Examples
Add user as primary site collection administrator
Adds group as secondary site collection administrator
Response
This command has no response