使用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. 【牛客练习赛 25】A 因数个数和

    题目地址:https://www.nowcoder.com/acm/contest/158/A 参考博客:https://blog.csdn.net/zzcblogs/article/details/ ...

  2. (12) OpenSSL主配置文件openssl.cnf

    1.man config 该帮助文档说明了openssl.cnf以及一些其他辅助配置文件的规范.格式及读取方式.后文中的所有解释除非特别指明,都将以openssl.cnf为例. [root@local ...

  3. HTML5新增的非主体元素header元素、footer元素、hgroup元素、adress元素

    ---恢复内容开始--- header header元素是一种具有引导和导航作用的结构元素,通常用来放置整个页面或页面内的一个内容区块的标题,但是也可以包含其他内容,例如数据表格.搜索表单或相关的lo ...

  4. @ApiParam @RequestParam @PathVariable 用法

    文章来源:https://www.cnblogs.com/hello-tl/p/9204279.html 1.@ApiParam ,是注解api的参数 ,也就是用于swagger提供开发者文档 ,文档 ...

  5. Codeforces 5D Follow Traffic Rules

    [题意概述] 某个物体要从A途经B到达C,在通过B的时候速度不能超过vd.  它的加速度为a,最大速度为vm:AB之间距离为d,AC之间距离为L: 问物体最少花多少时间到达C. [题解] 分情况讨论. ...

  6. SpringBoot自定义Filter

    SpringBoot自定义Filter SpringBoot自动添加了OrderedCharacterEncodingFilter和HiddenHttpMethodFilter,当然我们可以自定 义F ...

  7. gerrit ssh 登陆设置

    [root@web ~]# cat ~/.ssh/config Host gerrit User deploy-gerrit Port Hostname gerrit.demo.com Identit ...

  8. linux mail 发邮件

    system('echo "'.$xmlHeader.$xmlBody.$xmlFooter.'" | mail -s "百度新闻源生成成功,地址=>http:// ...

  9. LightOJ1094 - Farthest Nodes in a Tree(树的直径)

    http://lightoj.com/volume_showproblem.php?problem=1094 Given a tree (a connected graph with no cycle ...

  10. Java课堂测试--实现ATM的基本操作体会

    9月20的周四的Java课堂第一节课上就是有关于实现ATM的考试内容,在实现的过程中我了解到自己本身还是有很多的不足之处,例如在实现工程方面的相似性上面还有些许就的欠缺,再者就是回宿舍拿电源的原因导致 ...