使用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. [CF] 950B Intercepted Message

    B. Intercepted Message time limit per test1 second memory limit per test512 megabytes inputstandard ...

  2. 关键css

    参考: 掘金-JS和CSS的位置对资源加载顺序的影响 起舞-什么是关键CSS 有兴趣也可以看看这里一篇关于页面加载的文章.以上掘金那篇文章说css的加载不会影响其他资源的下载,但是我测试了一下,发现是 ...

  3. 如何用纯 CSS 创作一个充电 loader 特效

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

  4. CSS---基础外部样式表

    <link rel="stylesheet" type="text/css" href="style.css" media=" ...

  5. python中unicode, hex, bin之间的转换

    python中unicode, hex, bin之间的转换 背景 在smb中有个feature change notify, 需要改动文件权限dacl,然后确认是否有收到notify.一直得不到这个d ...

  6. 【C#】【数据结构】001-线性表:顺序表

    C#数据结构:顺序表结构 1.自定义顺序表结构 using System.Collections; using System.Collections.Generic; /// <summary& ...

  7. Struts2的Action配置的各项默认值

    1 如果没有为action指定class,默认是ActionSupport 2 如果没有为action指定method,默认执行action中的execute()方法 3 如果没有指定result的n ...

  8. .net中的协变和逆变

    百度:委托中的协变和逆变. 百度:.net中的协变和逆变. 协变是从子类转为父类. 逆变是从父类到子类. 这样理解不一定严谨或者正确.需要具体看代码研究.

  9. 使用dd命令快速生成大文件或者小文件的方法

    使用dd命令快速生成大文件或者小文件的方法     转载请说明出处:http://blog.csdn.net/cywosp/article/details/9674757     在程序的测试中有些场 ...

  10. 只有代码不会撒谎,如何通过Spring boot源码查看其对于各个框架的默认配置

    我发现很多开发对于看源码都有种恐惧心理,其实不必这样,大部分优秀的源码写的都挺直观的,很多时候,你在搜索引擎上搜到的一些东西并不一定是对的,但源码肯定造不了假,毕竟不管你怎么想,它就在那里,该是什么意 ...