使用PowerShell 创建SharePoint 站点

        在SharePoint开发中,你应该学会使用PowerShell管理SharePoint网站。SharePoint Management Shell是一个Windows PowerShell模块,你能够用它高效管理SharePoint 用户、网站、网站集和组织。

        这里教你简单的语句,创建一个SharePoint站点。

        输入下面语句。红色框内信息是按下Enter后出现的。

        建立的站点例如以下:

        首先我们须要理解怎样使用PowerShell创建网站。

new-spweb这一特殊命令仅仅有一个必要元素,即网站的URL。可是也有更多參数。在创建网站时使用能够丰富网站信息。

-url:新创建网站的URL。

-template: 加入模板号。
-name: 显示网站名称。

-AddToTopNav: 是否要网站显示在顶部导航栏。
-UseParentTopNav:是否要网站使用父网站的导航。
        经測试,支持汉字站点名称。
        关于SharePoint 2010 网站模板名称与ID的相应,请查看http://blogs.msdn.com/b/richin/archive/2011/07/04/sharepoint-2010-site-template-names.aspx
        假设你不确定哪些模板是可用的。你能够使用Get-SPWebTemplate返回可用模板的列表。

补充

创建新的Web应用程序

New-SPWebApplication -Name <name>-HostHeader <hostheader> Port <port>  -Url<url> -ApplicationPool <application pool> -ApplicationPoolAccount <applicationpoolaccount> –DataBaseName <databasename>
                                                           ------------------------------------切割线----------------------------------------
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”

删除Web应用程序

Remove-SPWebApplication http://intranet.company.com -DeleteIISSite -RemoveContentDatabase -Confirm:$false

创建内容数据库

New-SPContentDatabase -Name<ContentDBName> -WebApplication <WebApplicationName>
                                                           ------------------------------------切割线----------------------------------------
New-SPContentDatabase -Name WSS_Content_Intranet_Sales -WebApplication http://intranet.company.com

创建站点集

New-SPSite -URL “<URL for the new site collection>” -Name <name>  -ContentDatabase <content database name> -OwnerAlias “<domainuser>” -Template <template>
                                                           ------------------------------------切割线----------------------------------------
New-SPSite -URL “http://intranet.company.com/sites/sales” -Name “Sales” -ContentDatabase  WSS_Content_Intranet_Sales -OwnerAlias “COMPANYSPAdmin” -Template “STS#0″
        以上也不是什么新的知识,在其它地方你也可以看到。

我这里总结一下,仅仅是为了以后须要的时候,可以非常快地引用它们。

使用PowerShell 创建SharePoint 站点的更多相关文章

  1. SharePoint自动化系列——通过PowerShell创建SharePoint Site Collection

    通过PowerShell创建SharePoint Site Collection,代码如下: Add-PSSnapin microsoft.sharepoint.powershell function ...

  2. SharePoint自动化系列——通过PowerShell创建SharePoint Web

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PS ...

  3. SharePoint自动化系列——通过PowerShell创建SharePoint Lists

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PS ...

  4. SharePoint自动化系列——通过PowerShell创建SharePoint List Items

    转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PS ...

  5. SharePoint 2013 使用PowerShell创建State Service

    今天,搞SPD配置的sp2010wf迁移到sp2013环境上去,发布解决方案都很正常,给列表添加wf的时候报错“该表单无法显示,可能是由于 Microsoft SharePoint Server St ...

  6. 如何通过PowerShell在Visual Studio的Post-build中预热SharePoint站点

    问题现象 Visual Studio在开发SharePoint的时候,发布部署包后,首次打开及调试站点页面的时候会非常的慢 解决方案 使用PowerShell脚本,加载SharePoint插件后遍历所 ...

  7. 将SharePoint站点另存为模板并根据模板创建站点!

    1,将SharePoint站点模板另存为模板. 在网站设置—网站操作一栏下面可以将网站另存为模板. 这儿应该注意:有的时候“将网站另存为模板这个”链接看不到,这个时候打开管理网站功能链接,查看一下“S ...

  8. c# sharepoint client object model 客户端如何创建中英文站点

    c# sharepoint client object model 客户端如何创建中英文站点 ClientContext ClientValidate = tools.GetContext(Onlin ...

  9. Office 365 - Windows PowerShell for SharePoint Online

    Office 365 PowerShell for SharePoint Online 1. Get-SPOTenantLogEntry 并不能获取所有的Log信息,只能用于获取因外部资源而出错的lo ...

随机推荐

  1. 服务器编程心得(四)—— 如何将socket设置为非阻塞模式

    1. windows平台上无论利用socket()函数还是WSASocket()函数创建的socket都是阻塞模式的: SOCKET WSAAPI socket( _In_ int af, _In_ ...

  2. 牛客OI赛制测试赛2 D 星光晚餐

    链接:https://www.nowcoder.com/acm/contest/185/D来源:牛客网 题目描述 Johnson和Nancy要在星光下吃晚餐.这是一件很浪漫的事情. 为了增加星光晚餐那 ...

  3. STL源码分析-iterator(迭代器)

    1. GOF 迭代器设计模式 前面一篇文章有写到stl_list的实现,也实现了一下相应的iterator,但是后面觉得,实现具体容器之前有必要介绍一下iterator(迭代器) .那么迭代器是什么呢 ...

  4. set指令详解

    set指令详解 功能说明:设置shell 语 法:set [-abefhkmnptuvxBCHP] [-o option-name] [--] [arg ...] 说 明:设置或取消设置shell选项 ...

  5. python 05 关于对python中引用的理解

    数据的在内存中的地址就是数据的引用. 如果两个变量为同一个引用,那么这两个变量对应的数据一定相同: 如果两个变量对应的数据相同,引用不一定相同. 通过id(数据)可以查看数据对应的地址,修改变量的值, ...

  6. 如何用纯 CSS 创作炫酷的同心矩形旋转动画

    效果预览 在线演示 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/bMvbRp 可交互视频教 ...

  7. reversing.kr easykeygen 之wp

    补充: int(x,[base]): 就是将x(通常是一个字符串)按照base进制转换成整数. 比如: ’) ##转换成整数10 ) ##'按16进制转换,将得到整数16 ) ##得到255 int( ...

  8. POJ 3258 River Hopscotch (二分法)

    Description Every year the cows hold an event featuring a peculiar version of hopscotch that involve ...

  9. 一个可以获取知乎timeline的爬虫

    # -*- coding: utf-8 -*- import requests import lxml import os,time from bs4 import BeautifulSoup as ...

  10. 使用hadoop mapreduce分析mongodb数据

    使用hadoop mapreduce分析mongodb数据 (现在很多互联网爬虫将数据存入mongdb中,所以研究了一下,写此文档) 版权声明:本文为yunshuxueyuan原创文章.如需转载请标明 ...