-
Notifications
You must be signed in to change notification settings - Fork 195
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
SetSiteCollectionAdminsAsync doesn't set a single site collection administrator #1165
Comments
@lucmoco : this method indeed does not remove site collection admins, I'll clarify that in the docs. I think it's better to also include a remove method that allows for removal of a secondary administrator or a owner from the Microsoft 365 group when the site is group connected. |
@jansenbe, thank you for your explanation. But in that case, is there a possibility to set a single administrator, or do I have to wait for the secondary administrator or owner removal method ? In my case the site is not group-connected, it's a communication site, but of course it would be good to support both scenarios. |
@lucmoco : correct, we'll first have to add a removal method allowing you to remove the secondary admin. Depending on how time sensitive your ask is you can code this yourselves via our custom API support (https://pnp.github.io/pnpcore/using-the-sdk/basics-customapirequests.html). |
@jansenbe @lucmoco So something like |
@mloitzl, yes, that could be a possibility. Having such a method would certainly be useful, but in my case I would have to diff the current admins with the wished ones and compute the list of admins to remove. Certainly not impossible but I would prefer having a flag stating if we want to add only administrators (the current behaviour) or set the exact list of administrators. This could be for example an additional parameter in the public enum CollectionUpdateOptions
{
/// <summary>
/// Add additional items to the collection, but do not remove items.
/// </summary>
AddOnly,
/// <summary>
/// Update the collection so it matches the provided items, adding and removing items as needed.
/// </summary>
SetExact,
} The default value would be |
Thanks for thinking along for a solution @mloitzl and @lucmoco :-) I've been checking again on how things currently work in tenant admin and I'm proposing the following. Let's stick with the existing Next to that it would be great to have a method The returned value is a @mloitzl : would you be so kind to work on this? |
@jansenbe Thanks for your clarifications. |
Category
Describe the bug
I'm using the
ISiteCollectionManager.SetSiteCollectionAdminsAsync
method to set the site collection administrators of a communication site.When I call this method with a single user in
sharePointAdminLoginNames
, the method sets the user as primary site collection administrator (which is correct) but does not remove other site collection administrators.Steps to reproduce
ISiteCollectionManager.SetSiteCollectionAdminsAsync
to set UserB as single site admin (and thus primary site admin):Expected behavior
I expect the following list of site administrators:
Instead, I get the following list of site administrators:
Environment details (development & target environment)
The text was updated successfully, but these errors were encountered: