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


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 

Thursday 5 October 2017

Remove Mantainance Mode of SharePoint Site

PowerShell Script to remove Maintenance of a site


asnp "*sh*"

$Admin = new-object Microsoft.SharePoint.Administration.SPSiteAdministration('http://siteurl/’)