通过PowerShell创建SharePoint Site Collection,代码如下: Add-PSSnapin microsoft.sharepoint.powershell function CreateTeamSite() { $webApps = Get-SPWebApplication $webAppsUrl = $webApps.Url ) { Write-Host "You have only one web application:" Write-Host $we…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin Microsoft.SharePoint.PowerShell function createSPWeb() { $webApps = Get-SPWebApplication chooseWebAppAndSelectSite $webApps } function chooseWe…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin microsoft.sharepoint.powershell function CreateSPLists() { $sites = Get-SPSite ) { Write-Warning "There is no site available." CreateSPLis…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 代码如下(保存到本地ps1文件中,右键run with PowerShell即可): Add-PSSnapin microsoft.sharepoint.powershell function CreateSPListItems() { $sites = Get-SPSite ) { Write-Warning "There is no site available." CreateS…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ PowerShell是基于.NET的一门脚本语言,对于SharePoint一些日常操作支持的很好.今天上午同事做数据量测试,要在一个site下创建500个list和500个library,在一个list中创建1000个item,这样的需求通过PowerShell脚本实现是非常容易的. 下面是为这项测试写的两个小 Add-PSSnapin Microsoft.SharePoint.PowerShe…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 日常的SharePoint站点测试中,我们经常要做各种各样的数据,今天又写了几个脚本,发现自己写的脚本越来越多,所以我决定整理一下,并把一些常用的可复用的方法陆续发布上来. 今天先讲一下用PowerShell上传文件到SharePoint library中的方法,代码如下: Add-PSSnapin Microsoft.SharePoint.PowerShell function CreateA…
使用PowerShell 创建SharePoint 站点         在SharePoint开发中,你应该学会使用PowerShell管理SharePoint网站.SharePoint Management Shell是一个Windows PowerShell模块,你能够用它高效管理SharePoint 用户.网站.网站集和组织.         这里教你简单的语句,创建一个SharePoint站点.         输入下面语句.红色框内信息是按下Enter后出现的.         建立…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 需求:在不同的测试用例中,对脚本中不确定的因素需要和用户交互来确定,比如选择哪个site,选择哪个web,选择哪个list.当然也可以手动的copy url来传参到脚本,不过比较不友好.最好的方法是不需要复制粘贴这种,直接在不确定因素的地方做出个导航菜单来,让脚本使用者自选. 代码如下: Add-PSSnapin Microsoft.SharePoint.PowerShell function…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ SharePoint Content Deployment prerequisite——Error features deactivate automation 对于Content Deployment的过程简而言之就是: General Application Settings -> Content Deployment -> 1) Configure content deployment…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 本来的想法是做一个可以自动卸载并且部署新solution到SharePoint farm的tool.但是最后只做到retract成功和remove solution之前这个阶段.因为一个原因(等待solution retracted的过程中出现CLR方面的问题)导致不能将整个过程连续起来,这是相关的博问,希望有高手可以解惑. 下面的tool将会根据SharePoint solution wsp文…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 你可以将普通的sites加入到你的site subscriptions中,前提是你需要有一个 Tenant Administration site,如果没有这个site,一切都别谈了. 那么首先,创建一个 Tenant Administration site: Add-PSSnapin microsoft.sharepoint.powershell function CreateATenantA…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ PowerShell脚本实现MMS group.termSet.terms的自动化创建: Add-PSSnapin Microsoft.SharePoint.PowerShell function CreateTerms{ param($siteUrl,$groupName,$termSetName,$termsCount) #Connect to the Metadata Service $t…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 本章将总结一下设置SharePoint list中item的Managed Metadata field value的方法. 以下函数是我封装好的可以直接用来获取相应Managed Metadata类型field的terms value: Add-PSSnapin Microsoft.SharePoint.PowerShell function GetFieldTerms { param($si…
Coded UI非常好,我开始还在想,怎么样能让一个通过SharePoint Designer创建的Workflow publish三百五十次?想不到一个好的方法,也不知道SharePoint Designer里那个publish按钮调用的是什么方法,想来想去还是用Coded UI尝试了一下,发现也挺好,在资源允许的情况下,就这样完成了SPD Workflow的自动化创建: 1. 首先,你得有个SPD Workflow 2. 通过我第一次录制的脚本发现,SharePoint本身有个bug,就是如…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 将创建好的content type(若是跨web application需要事先publish content type,并在Monitor中跑和Content type同步相关的job,这里我写好了一个脚本,一键执行所有和content type相关的jobs)添加到指定的SharePoint list中,代码如下(以下代码保存到桌面“AddCTToList.ps1”文件中): Add-PSS…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 实现过程:在本地创建一个local user并将该user添加到Administrators组中,然后在SharePoint指定site中添加该user,并赋予Full Control的权限. 脚本如下: function AddUserToSPSite { param($siteUrl,$userName,$pwd,$fullName,$dspt) #Create a local user a…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ C#中通过Selenium定位页面上的select-option结构,尝试了以下几种方法,均没有生效: //iw.FindElement(By.CssSelector("select#id > option[value='']")).Click(); //iw.FindElement(By.XPath("//select[@id='']/option[@value=''…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 问题1: 1.如果SharePoint item被添加了hold,通过UI界面来对SharePoint items解锁是比较折腾的. 2.而且这其中存在一个问题,我们可以看作是已知问题——对于文件的解锁,是可以通过UI界面完成的:而对于list中的items,我们通过UI界面是无法完成解锁的,因为当你在item中上传附件并对其添加hold后,你是无法通过item的Property->Advanc…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 目的:批量的将SharePoint items变成records或者将records变成普通的items. 1.Add records(用处不大,SharePoint中可以批量添加records,还算方便): Add-PSSnapin Microsoft.SharePoint.PowerShell function AddRecords($webURL,$listTitle) { $web =…
转载请注明出自天外归云的博客园:http://www.cnblogs.com/LanTianYou/ 背景: 在SharePoint Central Administration->Monitoring->Job Definitions中我们可以看到所有的timer jobs,其中和Content Type相关的timer jobs有: 1.Content Type Hub 2.Content Type Sucscriber(job definition的数量等于于web applicatio…
在之前的文章中,通过SharePoint Central Administration 创建了Web Application.在这篇文章中将继续SharePoint 2013之旅——还是以Step By Step的形式演示如何在SharePoint 2013中创建Site Collection(网站集),首先梳理下知识点. Site Collection Site Collection是Sites(网站)的集合. Site Collection最大可以包含250000个Sites和Sub Sit…
这几个月一直在帮客户改需求,部署.我已经心力憔悴,经过一段时间的摸索,我对用PowerShell实现自动化部署也有了一些心得,比如说利用PowerShell导出导入AD中的User.在基于SharePoint平台开发时,利用AD来进行人员的管理,一般会建组织单元(OrganizationalUnit)来对用户进行管理.当最终部署到客户的服务器上时,怎样把本地AD中的用户数据同步到服务器上呢,要知道如果手动输入人员是一件麻烦的事.幸运的事,PowerShell可以帮我们解决这个麻烦的问题. 导出A…
I had created a site collection. But there is a problem of web-frontend server (I did not know when I created the site), so the page is always in processing. After waiting 40 mins, I closed the page. When the problem of web-frontend server solved, I…
In this post I will introduce a way how to run a script for backing up SharePoint data which could be scheduled to run automatically. Step 1:Create a PowerShell Script for Backing up a site collection param([string] $site,[string] $dir,[string] $type…
这是对上一篇文章<SharePoint自动化部署,利用PowerShell 导出/导入AD中的用户>进行补充.开发时,为了测试和演示,我们往往需要经常性的把用户添加到AD中.数据量小的时候,不麻烦,手动也是可以解决了.但是如果数据量很大时,比如帮助客户导入数据,手动操作就显得不那么乐观了.所以需要借助PowerShell来导入人员(.csv)数据.在上一篇文章中,自动化部署也有这个功能,但由于时间紧张,写得并不是很完善.所以趁今天有空,特此完善更新下. 首先,需要将人员以.csv格式导出,详见…
今天,搞SPD配置的sp2010wf迁移到sp2013环境上去,发布解决方案都很正常,给列表添加wf的时候报错“该表单无法显示,可能是由于 Microsoft SharePoint Server State Service 配置不当.有关详细信息,请与服务器管理员联系”,应该是SharePoint 2013的wf需要这个服务,所以要先创建这个服务. 1.首先打开管理中心,找到服务器上的服务,准备使用CA的UI创建这个服务,结果发现UI上没有这个服务,如下图: 2.只好谷歌TechNet使用Pow…
先需要将自定义的站点模版从网站集转移到Farm中. 找一个自己已经完成配置及设计的网站,在网站设置里面选择另存为模版.要注意的是不是所有的站点类型都有另存为模版的功能. 存完之后可在解决方案库的界面里面看到刚刚保存的模版,点击下载到本地 下载到本地之后用VisualStudio创建项目中的Import Solution Package项目模版创建项目并打开此文件 打开项目中的Feature3,然后将Scope选择为Farm,其他不需要改. 然后发布即可 执行Powershell语句,由于我的模版…
目录 怎样使用SPSD 配置Environment XML文件 PowerShell激活Feature  上篇博客讲了利用PowerShell导出.导入AD中的Users.这篇介绍简单介绍一下SPSD工具包(因为官网已经有非常详细的讲解),接着是附录了一些常用的PowerShell脚本,用于我在部署的时候快速导入css.js.images.设置MasterPage.创建权限组.分配权限等. SharePoint Solution Deployer(SPSD)能快速帮助程序员部署WSP,使用SPS…
Office 365 PowerShell for SharePoint Online 1. Get-SPOTenantLogEntry 并不能获取所有的Log信息,只能用于获取因外部资源而出错的log信息,比如 BCS错误,详情请见此页: The Get-SPOTenantLogEntry cmdlet cannot retrieve all SharePoint Online errors. This cmdlet retrieves a subset of errors that happ…
When you migrate list or site, the user alerts in the site will not be migrated together with the content. Below content can help you to do this task. But please take care of it, if you operate it on Prod environment. Enable or disable alerts for Web…