Wednesday, December 30, 2015

Tuesday, December 29, 2015

View All Site collections by using Power shell sharepoint 2013

Get-SPWebApplicaiton -Limit All | "|Get-SPSite | Format-Table -Property URL,ContentDatabase

Displays the URLS of all the web applications in a server farm and the site collections in each web application.

Manage the lock status for a site collection using power shell sharepoint 2013

Set-SPSite -identity "<SiteCollection>" -LockState "<State>"
State= Unlock /NoAdditions/Readonly/NoAccess

Restore a Deleted Site Collection using Power shell sharePoint 2013

When a site collection is deleted the deleted site collection is stored in the SPDeletedSite Object.
Restore-SPDeletedSite [-identity] <SPDeletedSitePipeBind> [...]

Restore-SPDeletedSite -identify guid or /sites/site_name or an SPDeletedSite Object

Delete a Site Collection Using Power shell SharePoint 2013

Remove-SPSite -Identity "<URL>" -GradualDelete

Create Site collection using power shell sharepoint 2013












Ex:1
New-SPSite -URL  "http://www.contoso.com/sites/eTeamSite"  -OwnerAlias "Contoso\Administrator" -Template "STS#0"


Ex:2

$template= Get-SPWebTemplate "STS#1"
New-SPSite  -URL "http://www.contoso.com/sites/Leere" -OwnerAlias "CONTOSO\GarethF" -Template $template