PowerShell 发布farm solution
SharePoint PowerShell在SharePoint Product列表里边,然后以管理员权限启动。
1. 添加Solution 到 SharePoint Farm.
Add-SPSolution D:\Sp2010\DeploySolution\MySharepointProject.wsp (farm)
Add-SPUserSolution -LiteralPath "c:\ilt.wsp" (sandbox)
2.获取已添加到SharePoint Farm的Solutions.
Get-SPSolution
3. 部署Solution 到SharePoint。
部署Solution到SharePoint Farm中:
Install-SPSolution –Identity MySharepointProject.wsp –WebApplication http://myserver-sp1:2010/ -GACDeployment
Install-SPSolution -Identity ilt.wsp -GACDeployment
–GACDeployment 参数也可换成–CASPolicies,二者区别是
GACDeployment指定可以为新 SharePoint 解决方案部署全局程序集缓存 (GAC)。。
CASPolicies指定可以为新 SharePoint 解决方案部署代码访问安全 (CAS) 策略。
- WebApplication参数也可换成- AllWebApplications,二者区别是:
WebApplication: 为指定 SharePoint Web 应用程序部署 SharePoint 解决方案。该类型必须是格式为 12345678-90ab-cdef-1234-567890bcdefgh 的有效 GUID;
SharePoint Web 应用程序的有效名称(例如,MyOfficeApp1);或有效 SPWebApplication 对象的实例。
AllWebApplications: 指定为服务器场中的所有 SharePoint Web 应用程序部署新的 SharePoint 解决方案。
如果你需要强制部署此Solution,你可以使用-Force参数。
| Error | Solution |
| Install-SPSolution : Admin SVC must be running in order to create deployment timer job. | Open services.msc and start the service named SharePoint 2010 Administration. |
|
Install-SPSolution : A deployment or retraction is already under way for the solution "webpartmanualdeployment.wsp", and only one deployment or retraction at a time is supported. |
Go to Central Administration > System Settings > Manage farm solutions > Cancel / Retract the particular solution |
部署Solution到指定的WebApplication中:
Install-SPSolution -Identity ilt.wsp -WebApplication http://sea:31996 -GACDeployment
我们也可使用–AllWebApplications参数来一次性从此Sharepoint Farm中的所有部署此Solution的Web Application中回收Solution.
插曲, 当部署到指定Web Application 遇到错误的时候, 要建一个Dummy data, 制定DeploymentTarget 为 WebApplication: 参考: http://sharedpointers.blogspot.in/2011/03/deploying-solutions-to-specific-web.html
即:
- Double click the package
- Open the Advanced
- add an additional assembly (the solution for example) and mark Deployment Type "Web Application"
4. 升级已部署的Solution
Update-SPSolution -Identity ilt.wsp -LiteralPath "C:\ilt.wsp" -GACDeployment
5.卸载已部署的Solution
Uninstall-SPSolution -Identity ilt.wsp
Web Application 级别的:
Uninstall-SPSolution -Identity ilt.wsp -WebApplication http://sea:31996
6.移除已卸载的Solution
Remove-SPSolution -identity ilt.wsp
Possilble Errors:
Remove-SPSolution: The solution cannot be removed when a job is scheduled or running.

这里介绍一种方法来撤销这个部署的工作。
使用Stsadm -o enumdeployments 获取JobId,:
.png)
然后使用 stsadm -o canceldeployment -id JobId 来取消部署工作。
Add-SPSolution C:\Users\akmii\Documents\Akmii.WuXiAppTec.Common.wsp
//deploy wsp 包
Install-SPSolution -Identity Akmii.WuXiAppTec.Common.wsp -GACDeployment –Force
//更新wsp包
Update-SPSolution -Identity Akmii.BMS.China.IHM.wsp -LiteralPath C:\WSP\Wsp-Xian\Akmii.BMS.China.IHM.wsp -GACDeployment -force
//强制删除
stsadm -o deletesolution -name akmii.museum.defines.wsp -override
//回收已经部署的Solution:
Uninstall-SPSolution –Identity MySharepointProject.wsp –WebApplication
//移除Solution
Remove-SPSolution –Identity MySharepointProject.wsp -Force
stsadm -o deploysolution -name Akmii.Museum.Web.wsp -immediate -allowGacDeployment -force
PowerShell 发布farm solution的更多相关文章
- [Powershell]发布基于.NET Framework的WebAPI和Job控制台程序项目
获取要发布的定时计划任务. 禁用和停止定时计划任务. 批量强制结束Job进程. 打印定时计划任务状态. 备份项目文件夹. 发布项目文件夹. 删除部署包. 启用定时计划任务. <# .NOTES ...
- Export Farm Solution wsp Files SharePoint 2007 and 2010
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")$farm = [Microsof ...
- PowerShell~发布你的mvc网站
通过使用ps加上msbuild可以方便的编译你的.net应用程序,并且可以把它发布到你的磁盘上,部署非常方例! 我们在c盘添加一个hello网站,解决方案名是hello.sln,它的网站是hello. ...
- PowerShell实现基于SharePoint的网站HomePage Auto-Configure Solution
Home Page Web Parts Auto-Configuration PS:该项目为公司项目,我还是给他的名字屏蔽掉吧,这是我用PowerShell写的一个自动化升级工具,此为三部自动化工具的 ...
- powershell 操作sharepoint命令集
打开SharePoint 2013 Management Shell, and then run as administrator.执行如下命令 1. 添加wsp和安装Add-SPSolution - ...
- SharePoint 2013 Sandbox Solution
昨天在写SharePoint EventReceiver的时候遇到一个问题,创建了一个local farm SharePoint solution,添加了一个ItemAdded(SPItemEvent ...
- SharePoint Add-in Model 介绍 - 引文(先导篇)
1. SharePoint 平台 如果你已经很熟悉 SharePoint 平台,可跳过本章节. 1.1 SharePoint 是什么 在介绍 Add-in Model 之前,简要提一下 SharePo ...
- SharePoint 新特性及安装需知
以下内容转自Kaneboy 大牛,但我在安装正式版的过程中发现一些问题,主要是.net 版本的问题,弄了我一个晚上,我在下面标出来了.我的安装环境是Windows server 2012 R2 关于详 ...
- Sharepoint学习笔记—习题系列--70-573习题解析 -(Q115-Q117)
Question 115You create a timer job.You need to debug the timer job.To which process should you attac ...
随机推荐
- NOIP2017滚粗记
NOIP2017滚粗记 扯淡 考完联赛后一直在搞文化... 联赛过去了不知道多少天了才来写这东西.... Day0 早自习知道了要期中考试. 感觉心态炸裂了. 上午在乱敲板子.... 打了一堆莫名其妙 ...
- 借腾讯开源 VasDolly,谈谈 Android 签名和多渠道打包的原理!
一.前言 Hi,大家好,我是承香墨影! 当我们需要发布一款 App 到应用市场的时候,一般需要我们针对不同的市场生产不同的渠道包,它们使用的是同一套代码,只是会包含一些各自的渠道信息,用于我们做数据分 ...
- 一个简单的定时表达式(HH:mm:ss)解析
前言 为客户开发了一个日志监控程序,监听各频道是否正常工作.其中有一个功能是这样的,当所有频道正常运行一段时间后,语音提示值班人员系统运行正常.一开始,想法比较简单,设置了一个变量,在线程不断轮询的过 ...
- CentOS命令修改系统时间同步
使用Centos,遇到本地时间对不上,直接敲命令:date -s "2016-01-08 15:15:15"是立即生效了,但是重启后,系统时间还是原来的. 修改了其一是没有办法奏 ...
- 由select引发的思考
一.前言 网络编程里一个经典的问题,selec,poll和epoll的区别?这个问题刚学习编程时就接触了,当时看了材料很不明白,许多概念和思想没有体会,现在在这个阶段,再重新回头看这个问题,有一种豁然 ...
- hdu 2048 递推&&错排
直接贴出递推公式: cnt[n]=(i-1)*(cnt[n-1]+cnt[n-2]); 数组保存的是失败的种数 AC代码: #include<cstdio> const int maxn= ...
- uva1025 动态规划
这道题的边界是dp(T,N)=0,状态dp(i,j)表示在时间i.第j个车站最少等待时间,有三个决策:1.等1分钟 2.如果有向左的车,向左 3.若果有向右的车,向右 转移方程就是dp(i,j)=m ...
- easywechat--在thinkPHP5中的使用
1. 安装 1.1 v-4.0 版本要求 PHP版本在7.0以上 1.2 在项目目录下运行以下命令 若未安装composer,则先安装composer -> http://docs.phpcom ...
- 将DataSet转化成XML格式的String类型,再转化回来。
/// <summary> /// 获取DataSet的Xml格式 /// </summary> public static string GetDataSetXml(this ...
- SPI知识总结
SPI知识总结 一.定义 SPI(Serial Peripheral Interface--串行外设接口)总线系统是一种同步串行外设接口,它可以使MCU与各种外围设备以串行方式进行通信以交换信息. 优 ...