Lo script
PowerShell 2.0 permette di resettare la
default.master di un sito
SharePoint 2010 alla site definition anche in modo ricorsivo su tutti i sotto siti:
# File: UnghostMasterpage.ps1
# revert to site definition of default.master
# es: http://sharepoint/sites/F2 oppure http://sharepoint/sites/F1/* (sterisco) per ricorsione
param (
[string]$url = $(throw "specify rot site url")
)
write-host "starting $url ..."
Get-SPWeb $url -Limit aLL | % {
write-host $_.url -NoNewline
$f = $_.GetFile($_.ServerRelativeUrl + "/_catalogs/masterpage/default.master")
if($f.CustomizedPageStatus -eq [Microsoft.SharePoint.SPCustomizedPageStatus]::Customized) {
write-host " Customized" -f green
#$f.RevertContentStream()
} else {
write-host " Uncustomized"
}
}
per eseguirlo ricorsivamente sui sotto siti
.\UnghostMasterpage.ps1 http://sharepoint/sites/F1/*