SharePoint 2010 Windows PowerShell Commands - II

Some more PowerShell Commands

Collection Commands

Create Site
Collection :

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

Delete Site Collection :

-Identity "URL of site Collection" -GradualDelete

Change Site collection Quotas

Set-SPSite -Identity "SiteCollection Url" -MaxSize

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

Create a site

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