{"id":964,"date":"2012-02-19T19:04:00","date_gmt":"2012-02-20T03:04:00","guid":{"rendered":"http:\/\/blog.brainlitter.com\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/"},"modified":"2012-02-19T19:04:00","modified_gmt":"2012-02-20T03:04:00","slug":"how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell","status":"publish","type":"post","link":"https:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/","title":{"rendered":"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell"},"content":{"rendered":"<p>I <a href=\"http:\/\/blogs.msdn.com\/b\/jjameson\/archive\/2010\/05\/18\/use-powershell-to-quot-reset-to-site-definition-quot-in-sharepoint-server-2010.aspx\">couldn\u2019t get this to work<\/a> for me (maybe I was having a thick day) so I asked Colin to devise a way that worked in my situation).&#160; If you need to whack your SharePoint 2010 on the head with a big bat and make it forget all the customizations that have been perform on page and site definitions, then this is the script for you.     <br \/>Replace the <a href=\"http:\/\/portal.somewhere.com\/\">http:\/\/portal.somewhere.com\/<\/a> part with your root site collection and Execute from the SharePoint-enabled PowerShell command line: <\/p>\n<pre class=\"csharpcode\"><font color=\"#d16349\">$site = Get-SPSite <span class=\"str\">&quot;http:\/\/portal.somewhere.com&quot;<\/span> \n$sites = @(<span class=\"kwrd\">foreach<\/span> ($web <span class=\"kwrd\">in<\/span> $site.AllWebs) { \n$web | Select-Object -Property Url\nWrite-Debug <span class=\"str\">&quot;Resetting all pages in site ($($web.Url))...&quot;<\/span>\n$web.RevertAllDocumentContentStreams()\n$web.Dispose() \n}) | <span class=\"kwrd\">out<\/span>-File -filepath <span class=\"str\">&quot;c:Output.txt&quot;<\/span> \n$site.Dispose()<\/font><\/pre>\n<p>\n.csharpcode, .csharpcode pre<br \/>\n{<br \/>\n\tfont-size: small;<br \/>\n\tcolor: black;<br \/>\n\tfont-family: consolas, &#8220;Courier New&#8221;, courier, monospace;<br \/>\n\tbackground-color: #ffffff;<br \/>\n\t\/*white-space: pre;*\/<br \/>\n}<br \/>\n.csharpcode pre { margin: 0em; }<br \/>\n.csharpcode .rem { color: #008000; }<br \/>\n.csharpcode .kwrd { color: #0000ff; }<br \/>\n.csharpcode .str { color: #006080; }<br \/>\n.csharpcode .op { color: #0000c0; }<br \/>\n.csharpcode .preproc { color: #cc6633; }<br \/>\n.csharpcode .asp { background-color: #ffff00; }<br \/>\n.csharpcode .html { color: #800000; }<br \/>\n.csharpcode .attr { color: #ff0000; }<br \/>\n.csharpcode .alt<br \/>\n{<br \/>\n\tbackground-color: #f4f4f4;<br \/>\n\twidth: 100%;<br \/>\n\tmargin: 0em;<br \/>\n}<br \/>\n.csharpcode .lnum { color: #606060; }<\/p>\n<p>It will also output a list of the webs that were bonked to the file c:Output.txt.<\/p>\n<p>Hoping the above helps someone, when they absolutely need to hard reset to definition, particularly in an ugly\/adopted site collection migration scenario. (I won\u2019t go into the gory details of the one I had the pleasure of doing)<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I couldn\u2019t get this to work for me (maybe I was having a thick day) so I asked Colin to devise a way that worked in my situation).&#160; If you need to whack your SharePoint 2010 on the head with a big bat and make it forget all the customizations that have been perform on &hellip; <a href=\"https:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\"><\/a><\/p>\n","protected":false},"author":10,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":"","_jetpack_memberships_contains_paid_content":false},"categories":[334],"tags":[536],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.0 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge\" \/>\n<meta property=\"og:description\" content=\"I couldn\u2019t get this to work for me (maybe I was having a thick day) so I asked Colin to devise a way that worked in my situation).&#160; If you need to whack your SharePoint 2010 on the head with a big bat and make it forget all the customizations that have been perform on &hellip;\" \/>\n<meta property=\"og:url\" content=\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\" \/>\n<meta property=\"og:site_name\" content=\"Brainlitter - Inside the mind of Sean Wallbridge\" \/>\n<meta property=\"article:published_time\" content=\"2012-02-20T03:04:00+00:00\" \/>\n<meta name=\"author\" content=\"Sean Wallbridge\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sean Wallbridge\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\",\"url\":\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\",\"name\":\"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge\",\"isPartOf\":{\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#website\"},\"datePublished\":\"2012-02-20T03:04:00+00:00\",\"dateModified\":\"2012-02-20T03:04:00+00:00\",\"author\":{\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77\"},\"breadcrumb\":{\"@id\":\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Brainlitter\",\"item\":\"https:\/\/regroove.ca\/brainlitter\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#website\",\"url\":\"https:\/\/regroove.ca\/brainlitter\/\",\"name\":\"Brainlitter - Inside the mind of Sean Wallbridge\",\"description\":\"Dad. Husband. Drummer. Learner of Things.\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/regroove.ca\/brainlitter\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77\",\"name\":\"Sean Wallbridge\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g\",\"caption\":\"Sean Wallbridge\"},\"url\":\"https:\/\/regroove.ca\/brainlitter\/author\/swallbridge\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/","og_locale":"en_US","og_type":"article","og_title":"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge","og_description":"I couldn\u2019t get this to work for me (maybe I was having a thick day) so I asked Colin to devise a way that worked in my situation).&#160; If you need to whack your SharePoint 2010 on the head with a big bat and make it forget all the customizations that have been perform on &hellip;","og_url":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/","og_site_name":"Brainlitter - Inside the mind of Sean Wallbridge","article_published_time":"2012-02-20T03:04:00+00:00","author":"Sean Wallbridge","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Sean Wallbridge","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/","url":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/","name":"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell - Brainlitter - Inside the mind of Sean Wallbridge","isPartOf":{"@id":"https:\/\/regroove.ca\/brainlitter\/#website"},"datePublished":"2012-02-20T03:04:00+00:00","dateModified":"2012-02-20T03:04:00+00:00","author":{"@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77"},"breadcrumb":{"@id":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/regroove.ca\/brainlitter\/2012\/02\/19\/how-to-reset-all-sp-2010-site-pages-to-default-definitions-with-powershell\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Brainlitter","item":"https:\/\/regroove.ca\/brainlitter\/"},{"@type":"ListItem","position":2,"name":"How to Reset All SP 2010 Site Pages to Default Definitions with PowerShell"}]},{"@type":"WebSite","@id":"https:\/\/regroove.ca\/brainlitter\/#website","url":"https:\/\/regroove.ca\/brainlitter\/","name":"Brainlitter - Inside the mind of Sean Wallbridge","description":"Dad. Husband. Drummer. Learner of Things.","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/regroove.ca\/brainlitter\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/74e1c0def190f181c1394c2b6d883e77","name":"Sean Wallbridge","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/regroove.ca\/brainlitter\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/adf8cea6291c39d166616f2148d919a6?s=96&d=mm&r=g","caption":"Sean Wallbridge"},"url":"https:\/\/regroove.ca\/brainlitter\/author\/swallbridge\/"}]}},"jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts\/964"}],"collection":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/users\/10"}],"replies":[{"embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/comments?post=964"}],"version-history":[{"count":0,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/posts\/964\/revisions"}],"wp:attachment":[{"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/media?parent=964"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/categories?post=964"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/regroove.ca\/brainlitter\/wp-json\/wp\/v2\/tags?post=964"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}