site collection by using Windows PowerShell


Create a site collection by using Windows PowerShell
You typically use Windows PowerShell to create a site collection when you want to automate the task, which is common in enterprises.
To create a site collection by using Windows PowerShell
  1. Verify that you meet the following minimum requirements: See Add-SPShellAdmin.
  2. On the Start menu, click All Programs.
  3. Click Microsoft SharePoint 2010 Products.
  4. Click SharePoint 2010 Management Shell.
  5. From the Windows PowerShell command prompt (that is, PS C:\>), type the following command and press ENTER:
6.  Get-SPWebTemplate
7.  $template = Get-SPWebTemplate "STS#0"
New-SPSite -Url "<URL for the new site collection>" -OwnerAlias "<domain\user>" -Template $template
This example retrieves a list of all available site templates and then creates a site collection by using the Team Site template. For more information, see New-SPSite and Get-SPWebTemplate.
We recommend that you use Windows PowerShell when performing command-line administrative tasks. The Stsadm command-line tool has been deprecated, but is included to support compatibility with previous product versions.

Comments

Popular posts from this blog

React and SPFx Interview Questions with Scenarios and Code Examples

Automating ShareGate PreCheck Reports: From Manual Drudgery to Streamlined Efficiency

How to Automate SharePoint Site Creation with Site Scripts & Site Designs (2025)