Showing posts with label SharePoint Restore Deleted site using Powershell. Show all posts
Showing posts with label SharePoint Restore Deleted site using Powershell. Show all posts

Saturday, 28 October 2017

Restore Deleted SiteCollection PowerShell

PowerShell Script to Restore Deleted SiteCollection from a Webapplication 



Get the Specific Webapplication ID  and use GetDeltedSites() method to to find out ID your deleted sitecollection and use Restore-SPDeletedSite command let to restore the sitecollection


cls


Add-PSSnapin "Microsoft.SharePoint.PowerShell"

$WebApplication = Get-SPWebApplication -Identity http://spdev2016:2626/

$restore = $WebApplication.GetDeletedSites()


Restore-SPDeletedSite  -Identity 1b0af67e-2f0d-413c-b8b7-9dec119dbc8c -WebApplication 7f1ac80d-d8fb-4a0a-9715-3865a4d139c5 -Confirm:$false