[FEATURE] - Enhanced Permissions for Sync-PnPSharePointUserProfilesFromAzureActiveDirectory Command
I am writing to suggest an enhancement for the Sync-PnPSharePointUserProfilesFromAzureActiveDirectory command. Currently, according to the documentation available at [documentation] , the command requires the [User.Read.All] and [Sites.FullControl.All] permissions on SharePoint.
However, I would like to propose a change in the permissions required for this command. Instead of relying on [Sites.FullControl.All], I suggest implementing the use of [Sites.Selected] permissions. The rationale behind this request is that, based on my understanding (which may need verification), write access to SharePoint Online is only necessary for the site used in the connection, as indicated by the -Folder parameter.
By allowing the use of [Sites.Selected] permissions, the command can be more granular and secure. It would only require the necessary access level for the specific site being used, rather than requiring full control permissions for all SharePoint sites.
I believe this enhancement would provide users with more flexibility and control over the permissions required for executing the Sync-PnPSharePointUserProfilesFromAzureActiveDirectory command, aligning it better with the principle of least privilege.
Thank you for considering this feature request. I appreciate your time and attention to this matter. Please let me know if you require any further clarification or information.
The documentation says that the command also need Tenant permissions in ACS, so limiting the scope in AAD, would still not limit the write capabilities of the command.
hi @fredupstair and @gabbsmo - have updated the docs to reflect the usage of Sites.Selected permissions since we can use that for the file upload to folder process.
As @gabbsmo said, we will still require the full Tenant permissions in ACS via the appinv.aspx , we can't change that due to CSOM limitations.
Thanks for raising this feature request, the updated page will be available tomorrow onwards.