Kwizcom Forms

Remove-SPOSite Access denied You do not have permission to perform this action or access this resource

POowerShell online Remove-SPOSite Access denied

In this post, we will discuss how we can resolve the below issue which comes when tries to delete a SharePoint online site using PowerShell. I was trying to delete a site collection from SharePoint by using PowerShell.

Below is the command which I was using.

SharePoint deveopment training course

Import-Module Microsoft.Online.SharePoint.PowerShell -DisableNameChecking
Connect-SPOService -Url https://onlysharepoint2013-admin.sharepoint.com -credential bijay@onlysharepoint2013.onmicrosoft.com

Remove-SPODeletedSite -Identity https://onlysharepoint2013.sharepoint.com/sites/MySite -Confirm:$false

But it gave me below error:




Remove-SPOSite Access denied You do not have permission to perform this action or access this resource

POowerShell online Remove-SPOSite Access denied
POowerShell online Remove-SPOSite Access denied

Solution:
The problem was that the account I was using. The account should be a site collection administrator for the site which you are going to delete. After I add the user to the site collection administrator, I was able to delete the site collection.

Hope this might help someone.

Check out Best Alternative to InfoPath -> Try Now

free sharepoint training

SharePoint Online FREE Training

JOIN a FREE SharePoint Video Course (3 Part Video Series)

envelope
envelope

About Bhawana Rathore

Hello Everyone!! I am Bhawana a SharePoint MVP and having about 8+ years of SharePoint experience as well as in .Net technologies . I have worked in all the versions of SharePoint from wss to Office 365. I have good exposure in Customization and Migration using Nintex, Metalogix tools . Now exploring more in SharePoint 2016 :) Hope here I can contribute and share my knowledge to the fullest. As I believe "There is no wealth like knowledge, and no poverty like ignorance"

View all posts by Bhawana Rathore →