Thursday, October 4, 2012

How to create site collection in a Specified or default Content Database using PowerShell


In previous post, created web application using powershell.


Now , creating new site collection using powershell.


Method 1:

Creating new site collection in default content database of the web application.

New-SPSite -Url http://ukreddy:8998/sites/newsitecol2 -OwnerAlias "UKREDDYSYKAM\Administrator" -Name "newsitecollection" -Description "Sitecoll Description" -Template $template



Method 2:


We can create new site collection in a specific content database.

here,Creating new content database and then will create new site collection in newly created content database

a. New-SPContentDatabase -Name "WSS_Content_Developemnt" -WebApplication http://ukreddy:8998

b.

This can not be done from within Central Administration web site.

New-SPSite -Url http://ukreddy:8998/sites/newsitecol2 -OwnerAlias "UKREDDYSYKAM\Administrator" -ContentDatabase  WSS_Content_Developemnt  -Name "newsitecollection" -Description "Sitecoll Description" -Template $template

Method 3:

Create new site collection in a specific content database.

a. New-SPSite -Url http://ukreddy:8998/sites/newsitecol2 -OwnerAlias "UKREDDYSYKAM\Administrator" -ContentDatabase WSS_Content_8998 -Name "newsitecollection" -Description "Sitecoll Description" -Template $template

No comments:

Post a Comment