- If the publishing layout URL of a publishing page contains an incorrect top level site URL.
- If there is a problem with the Page Layout, or if the Page Layout is corrupted.
- If a content database was moved or a content deployment job was run.
Unfortunately, there is no user interface for restoring deleted site collections. Managing deleted site collections requires using PowerShell. SharePoint 2010 Service Pack 1 introduces 3 new PowerShell CmdLets for managing the Recycle Bin for site collections.
The easiest way to get a list of all the deleted site collections is to just call Get-SPDeleteSite without any parameters. In the following example, for brevity, I have formatted the output as a table and filtered the columns displayed. In the second sample, I have added a wildcard filter to the command that can be used to easily filter sites based on relative paths.
Once you have identified the site you want to restore, you call the Restore-SPDeletedSite. To restore one or more sites, it is easiest to just pipe the results from Get-SPDeletedSite. By default, the command will ask you to confirm the restore. To eliminate the confirmation, just add “Confirm:$true” to the end of the command.
For appending content to stringbuilder object we use Append() as
I created a new script containing the line below and clicked Debug.
At C:\Users\MyUser\Documents\slk.ps1:2 char:19
+ $spweb = Get-SpWeb <<<< http://myweb
Hmm, I guess I either need to 1) allow the SharePoint Cmdlets to run under .NET 4, 2) find an older version of PowerGUI, or 3) run PowerGUI under .NET 3.5. I chose option 3.
After some digging, I found the already-existant ScriptEditor.exe.config file inC:\Program Files (x86)\PowerGUI.
I opened it up with NotePad++ and noticed the following line:
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″ />
And promptly commented it out and saved the file.
<!– <supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.0″ /> –>
Next, I started up PowerGUI and was able to run the same SharePoint cmdlet.