PowerShell添加和部署WSP
SharePoint PowerShell在SharePoint Product列表里边,然后以管理员权限启动。
1. 添加Solution 到 SharePoint Farm.
Add-SPSolution -LiteralPath "c:\ilt.wsp"
2.获取已添加到SharePoint Farm的Solutions.
Get-SPSolution
3. 部署Solution 到SharePoint。
部署Solution到SharePoint Farm中:
Install-SPSolution -Identity ilt.wsp -GACDeployment
possible errors:
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
插曲, 当部署到指定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,:
然后使用 stsadm -o canceldeployment -id JobId 来取消部署工作。
stsadm -o canceldeployment -id 2529c788-971c-46a3-b69f-a2a0a1fcc851
参考: http://blog.sina.com.cn/s/blog_5245a6580100z9bd.html;
http://www.cnblogs.com/wsdj-ITtech/archive/2011/05/10/2041843.html;
PowerShell添加和部署WSP的更多相关文章
- 使用powershell部署WSP包
代码如下,先卸载,然后删除,然后添加,然后安装. 卸载之后会重启IIS,所以等待几秒钟,直到卸载完成. 添加snapin $snapin = Get-PSSnapin | Where-Object { ...
- SharePoint 2010 PowerShell 系列 之 备份、还原、部署 .WSP
转:http://www.cnblogs.com/Fengger/archive/2012/08/24/2654093.html PowerShell系列目录 最近在部署测试环境,就顺便把PowerS ...
- PowerShell命令部署WSP
转载:http://www.cnblogs.com/ChunLiangZhang/archive/2012/07/18/2597335.html(作者:ChunLiang) 现在可以用SharePoi ...
- 不直接登录SharePoint服务器,通过远程直接部署WSP解决方案包
在这之前不得不说一下Sysinternals,他最初是一个网站,网站上会经常发布一些有用的系统扩展工具,之后运营这个网站的公司被微软收购.像非常著名的Procmon,AutoRuns.Process ...
- SharePoint 2010 使用Install-SPSolution部署wsp包状态一直是”正在部署”
1.服务器场信息如下: 2.使用下面命令部署,状态一直是"正在部署" Install-SPSolution –Identity xxxx.wsp –WebApplication h ...
- 用PowerShell批量部署wsp包
转:http://www.xuebuyuan.com/168337.html 提供wsp部署的参数: $wsppath:wsp文件所在的路径,如"c:\" $wspnames:路径 ...
- 转载 SharePoint开发部署WSP解决方案包
转载原出处: http://642197992.blog.51cto.com/319331/1582731 注:本文所讲内容以SharePoint2013版本为例,开发工具以VS2013为基础.历史版 ...
- 使用命令部署wsp包,并将其部署到不同的web应用程序
http://www.c-sharpcorner.com/uploadfile/anavijai/how-to-deploy-a-wsp-using-powershell-in-sharepoint- ...
- PowerShell添加或修改注册表开机启动项脚本
代码如下: $name = Read-Host "请输入开机启动项的名字(随便起)" $value = Read-Host "请输入开机启动项的值" try{ ...
随机推荐
- xtu 1242 Yada Number 打表
Yada Number Time Limit : 2000 MS Memory Limit : 65536 KB Yada Number Problem Description: ...
- JConsole监控远程Tomcat服务器 遇到的坑
1. 报错 JConsole java net socketException: Connection reset 解决: 先查看linux服务器开放了哪些端口 netstat -ntpl 选中了一 ...
- java动态代理和cglib
1.代理类可以分为两种. 静态代理:由程序员创建或特定工具自动生成源代码,再对其编译.在程序运行前,代理类的.class文件就已经存在了. 动态代理:在程序运行时,运用反射机制动态创建而成. 2.JD ...
- 快速幂模n运算
模运算里的求幂运算,比如 5^596 mod 1234, 当然,直接使用暴力循环也未尝不可,在书上看到一个快速模幂算法 大概思路是,a^b mod n ,先将b转换成二进制,然后从最高位开始(最高位一 ...
- jQuery.extend()意义及用途
一.意义 用于将一个或多个对象的内容合并到目标对象 二.用法: $.extend( [deep ], target, object1 [, objectN ] ) 注意: 1. 如果只为$.exten ...
- Java使用Log4记录日志
我们在系统使用中,为了方便查找问题,因此需要记录操作的日志,而目前比较成熟稳定的程序日志记录方式就是Log4,本人也是菜鸟,然后再学习研究中就记录一下使用方式,以方便今后查阅,同时本文章参考了博客园: ...
- NotifyIcon实现托盘程序
NotifyIcon 控件的常用属性属性:Icon类型:System.Drawing.Icon说明:将在系统任务栏中显示的图标.可以在设计时指定,也可在运行时动态指定.属性:Text类型:String ...
- Android ListView常见配置说明
ListView是我们经常使用的控件,但是使用中却因为各种原因无法设置出我们需要的效果,现将常用的设置记录下来方便以后查询. 1.拖动时背景变黑 android:cacheColorHint=&quo ...
- Spring boot实现监听Redis key失效事件实现和其它方式
需求: 处理订单过期自动取消,比如下单30分钟未支付自动更改订单状态 用户绑定隐私号码当订单结束取消绑定等 解决方案1: 可以利用redis自带的key自动过期机制,下单时将订单id写入redis,过 ...
- 雷林鹏分享:Ruby 环境变量
Ruby 环境变量 Ruby 解释器使用下列环境变量来控制它的行为.ENV 对象包含了所有当前设置的环境变量列表. 变量描述 DLN_LIBRARY_PATH动态加载模块搜索的路径. HOME当没有参 ...