Remove-PnPTenantSite security issue
Reporting an Issue
Remove-PnPTenantSite security issue, When deleting a site collection using a global admin/SharePoint service admin who is not a site collection administrator for the target site, I get an error that the user doesnt have enough permissions even though the user can delete the site collection through the SharePoint -admin site
Expected behavior
Remove-PnPTenantSite -Url $siteCollectionUrl -Force:$true Deleted !
Actual behavior
Remove-PnPTenantSite -Url $siteCollectionUrl -Force:$true Remove-PnPTenantSite : Access denied. You do not have permission to perform this action or access this resource.
Steps to reproduce behavior
$userName : is the global admin $global:localSiteCollectionUrl : -admin site collection $siteCollectionUrl : Site collection where the global admin is not local administrator $securePassword = ConvertTo-SecureString $password -AsPlainText -Force $creds = New-Object System.Management.Automation.PSCredential($userName,$securePassword) Connect-PnPOnline -Url $global:localSiteCollectionUrl -Credentials $creds Remove-PnPTenantSite -Url $siteCollectionUrl -Force:$true
Which version of the PnP-PowerShell Cmdlets are you using?
- [ ] PnP PowerShell for SharePoint Online
What is the version of the Cmdlet module you are running?
2.11.1701.1
How did you install the PnP-PowerShell Cmdlets?
- [ ] Installed through the PowerShell Gallery with Install-Module
We closed this issue as it had not activity within last 180 days. This is a generic process we have decided to perform for issues, which have not been explicitly marked still to be "work in progress" based on tags. We are performing this cleaning to make sure that old issues that have already been solved (but not closed) or are no longer relevant are cleaned out and make the issues more manageable. If this issue still valid, we would ask you to open a new issue and follow the guidance in the issue template related on the recommended location. We do apologize any inconveniences this might cause. Please do remember that issues in the issue lists are also messages for others in the community, so you can also check if you can assist on any of them. “Sharing is caring!”