SharePoint Online Save As Template Access denied

While I was configuring a SPO tenant, i received an error when I tried to navigate to the url “_layouts/savetmpl.aspx” I receveid the error “You don’t have permissions to access to this site”. So what can we do?

Following the post you will need to use PowerShell to solve this problem.

First, open the SharePoint Powershell and type the following:

Connect-Sposervice -url “”

Set-sposite “” -denyaddandcustomizepages 0

Once this has been executed, you will be able to save the site as a template


How to secure guest links

In SPO, we have a little problem, because when we invite an external user to our tenant, this person will receive an invitation, but he/she can decide whether use it or not, and instead of using it, forward the invitation to someone else to access the site or document.

So to prevent this, we can use the following PowerShell:

Set-SPOTenant -RequireAcceptingAccountMatchInvitedAccount $true

This will require that only the owner will have access 🙂


How to delete sites from SPO recycle bin

By default, when you delete a SharePoint Online site collection from the SharePoint admin center, it is moved to the Recycle Bin, where it is retained for a 30-day period. But, what if you don’t want to wait 30 days? Or you need the quota that the site collection has or even you need to create a new SC with the same url? To all those question, PowerShell is your answer, so let’s begin:


$siteAdminURL = “”

Import-Module Microsoft.Online.SharePoint.PowerShell

connect-sposervice -url $siteadminurl -credential $cred

Get-SPODeletedSite | foreach {
Write-host “Deleting ” $_.Url
Remove-SPODeletedSite –Identity $_.Url –Confirm:$false

Master Page Gallery Access Denied

Today, a colleague was working in some customizations in SharePoint Online and he needed to access to the Master Page Gallery, he could access using the url, but when he tried to upload files he received the typical Access denied message.

I catch an eye to this weird behaviour and I realized that this was happening for any Site Collection administrator, so what was happening? tracking the issue we were able to discover by Check permission that the permission of “Adding or Customizing Pages” was denied in that library.

So my next step was to check if the scripting capabilities were turned on, in our case how the tenant was new the feature was set to Prevent, so I changed it to Allow


MS says that it is necessary to wait at least 24 hours to see the changes, but if you’re in a hurry and don’t want to waste your time, open your PowerShell Shell and execute the following:

Set-SPOsite “” -DenyAddAndCustomizePages 0

Once executed, the option of master page gallery will appear in the settings panel, so my colleague could continue with his work.

Hope it helps!

How to change regional settings with PowerShell

Recently I needed to change the regional settings for all the sites and site collection in a SharePoint 2013 farm, so I did it with Powershell.

But also, at the same time I needed to do it for a SPO tenant, so let’s PowerShell!

foreach ($webApplication in Get-SPWebApplication) {
Write-Host "Processing $webApplication"
Write-Host "******************************"

foreach ($site in $webApplication.Sites) {
$webs = $site.AllWebs
Write-Host "Processing $site"
Write-Host "******************************"
foreach ($web in $webs) {
Write-Host $web.Url

#If you need to change the timezone and local id in SharePoint Online, you can do it using the following:

#This is to change the LocalID
#First, set up your ClientContext in the normal manner:
$Password = ConvertTo-SecureString -String "yourPassword" -AsPlainText -Force;
$ctx = New-Object Microsoft.SharePoint.Client.ClientContext("");
$ctx.Credentials = New-Object Microsoft.SharePoint.Client.SharePointOnlineCredentials("", $Password);
#Now we need to set up our target web site object:
$web = $ctx.Web;
#Next, update the settings. In this example, I’m setting the LocaleId to 2057 (en-UK)
$web.RegionalSettings.LocaleId = 2057;
#Finally, run the ExecuteQuery method to apply the changes:

#The following is to change the zoneID for personal sites
Write-Host $persweb
Set-SPOUser -Site $persweb -LoginName $username -IsSiteCollectionAdmin $true

Set-SPoUserRegionalSetings -Username $Username -AdminPassword $AdminPassword -Url $AdminUrl -TimeZoneID $TimeZoneID

If you need to know which time zone ID is your region, visit: to check it

And If you need to check your local ID, visit: