Create a SharePoint site using PowerShell

Source: Internet
Author: User

To create a SharePoint site using PowerShell in SharePoint development, you should learn to manage SharePoint sites using PowerShell.        The SharePoint Management Shell is a Windows PowerShell module that you can use to efficiently manage SharePoint users, sites, site collections, and organizations.        This teaches you a simple statement to create a SharePoint site. Enter the statement. The information in the red box appears after you press ENTER.
The website is set up as follows:
First we need to understand how to create a site using PowerShell. New-spweb This special command has only one necessary element, the URL of the site, but there are many other parameters that can be used to enrich the site information when the site is created. -url: The URL of the newly created site. -template: Add the template number. -name: Displays the site name. -addtotopnav: Whether you want the site to appear in the top navigation bar.        -useparenttopnav: Whether you want the site to use the parent site's navigation.        Tested to support Chinese characters website name. For information about SharePoint 2010 site template names and IDs, see HTTP://BLOGS.MSDN.COM/B/RICHIN/ARCHIVE/2011/07/04/ Sharepoint-2010-site-template-names.aspx If you are not sure which templates are available, you can use Get-spwebtemplate to return a list of available templates.
Supplement Create a new Web application new-spwebapplication-name <name>-hostheader ------------------------------------Split Line----------------------------------------new-spwebapplication-name " Company Intranet "-hostheader" intranet.company.com "-port 80-url" http://intranet.company.com:80 "-applicationpool" SharePoint Web Applications "-applicationpoolaccount (Get-spmanagedaccount" Companysp_service ")-databasename" WSS_ Content_intranet "
Delete Web application remove-spwebapplication http://intranet.company.com-DeleteIISSite-RemoveContentDatabase-Confirm: $false
Create a content database new-spcontentdatabase-name<contentdbname>-webapplication <WebApplicationName>
------------------------------------Split Line----------------------------------------
New-spcontentdatabase-name wss_content_intranet_sales-webapplication http://intranet.company.com
Create a site collection New-spsite-url "<url for the new site collection>"-name <name>-contentdatabase <content database n ame>-owneralias "<domainuser>"-template <template>
------------------------------------Split Line----------------------------------------
New-spsite-url "Http://intranet.company.com/sites/sales"-name "Sales"-contentdatabase  wss_content_intranet_ Sales-owneralias "Companyspadmin"-template "sts#0″        Above is also not a new knowledge, in other places you can also see. I'll summarize here, just to be able to quote them very quickly for the time being needed.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.