Configure the site collections for the SharePoint Sites.Selected permission
Question / Problem
I try to scan my SharePoint sites using a certificate and the Sites.Selected permission, as told in the manual. How do i configure my site collections?
Answer / Solution
To grant permissions on the respective site collections to be scanned via TreeSize/SpaceObServer, the PowerShell cmdlet Grant-PnPAzureADAppSitePermission can be used.
- Import-Module PnP.Powershell
- Connect-PnPOnline -Url <SharePointSIteURL> -Interactive
- Grant-PnPAzureADAppSitePermission -AppId <AzureAppID> -DisplayName <AzureAppName> -Site < SharePointSiteURL> -Permissions write
The user that is used for granting the permission must be a site collection admin of the respective site collection. The role 'Owner' is not sufficient.
For more information about the used cmdlets please see: https://pnp.github.io/powershell/cmdlets/