Prasad Bolla's SharePoint Blog

Click Here to go through the Interesting posts within my Blog.

Click Here to go through the new posts in my blog.

Monday, December 05, 2011

SharePoint 2010 Windows PowerShell Commands Part2

Some more PowerShell Commands

Site Collection Commands

Create Site Collection :

Get-SPWebTemplate
$template = Get-SPWebTemplate "STS#0"
New-SPSite -Url "" -OwnerAlias "" -Template $template

Delete Site Collection :

Remove-SPSite -Identity "URL of site Collection" -GradualDelete

Change Site collection Quotas :
Set-SPSite -Identity "SiteCollection Url" -MaxSize Quota

Add site Collection Administrators :


Set-SPSite -Identity "" -SecondaryOwnerAlias ""

Lock or unlock a site collection :

Set-SPSite -Identity "Site Collection Url" -LockState ""

is one of the following vales :

# Unlock: To unlock the site collection and make it available to users.

# NoAdditions: To prevent users from adding new content to the site collection. Updates and deletions are still allowed.

# ReadOnly: To prevent users from adding, updating, or deleting content.

# NoAccess: To prevent access to content completely. Users who attempt to access the site receive an access-denied message.

Create a site :


New-SPSite "http://sitecollection/sites/Subsite -OwnerAlias "DOMAIN\UserName" –Language 1033

No comments:

Post a Comment