• 512-991-7197
  • This email address is being protected from spambots. You need JavaScript enabled to view it.
  • Always Open

Welcome to Microsoft SharePoint Tips & Tricks

Restore SharePoint Seattle masterpage


Star InactiveStar InactiveStar InactiveStar InactiveStar Inactive
 

With the script that we’re showing, you can reset the masterpage on a SharePoint site and get back to the default masterpage (Seattle). This command can be used by any SharePoint version, a few notes that I want the user to be aware before running this script.

  • It’ll only apply to the site that you’re connected and not all site collection
  • If you’ve custom masterpage with custom zones, you may have an error when accessing to pages because those zones don’t exist on the default masterpage.
  • Make sure you have the $site variable with /
  • On the $ domainUrl make sure you when the line without \.
  • If you’ve other type of security on login check the other options to login on the PnP
$domainUrl  = "https://contoso.sharepoint.com"
$site       = "/sites/contososite"
$username   = "This email address is being protected from spambots. You need JavaScript enabled to view it."
$password   = "password"

$encpassword = convertto-securestring -String $password -AsPlainText -Force
$cred = new-object -typename System.Management.Automation.PSCredential -argumentlist $username, $encpassword

Connect-PnpOnline -Url $domainUrl$site -Credentials $cred

Set-PnPMasterPage -MasterPageServerRelativeUrl $site/_catalogs/masterpage/seattle.master -CustomMasterPageServerRelativeUrl $site/_catalogs/masterpage/seattle.master 

Recommend other relevant articles:

 

 

© 2015 - 2020 Austin Laptop [AustinLaptop.Com]. All Rights Reserved.