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{ ...
随机推荐
- Linux——bash应用技巧简单学习笔记
本人是看的lamp兄弟连的视频,学习的知识做一下简单,如有错误尽情拍砖. 命令补齐 命令补齐允许用户输入文件名起始的若干个字 母后,按<Tab>键补齐文件名. 命令历史 命令历史允许用户浏 ...
- C# 二进制字符串互转
1.字符转二进制 public static string ChineseToBinary(string s) { byte[] data = Encoding.Unicode.GetBytes(s) ...
- 使用innerHTML时要注意的一点
为某个元素添加内容时,使用的是document.getElementsByClassName,由于只有一个元素拥有这样的ClassName,就直接这样用,document.getElementsByC ...
- Docker Container的概述
·通过Image创建(copy) ·在Image layer之上建立一个container layer(可读写) ·类比对象:类和实例(Image相当于抽象的一个类,Container相当于实例化的一 ...
- HDU 6124 Euler theorem
Euler theorem 思路:找规律 a 余数 个数 1 0 1 2 2 0 2 ...
- Lua面向对象 --- 封装
工程结构: Player.lua: Player = {} function Player:new() local self = {} setmetatable(self, {__index = Pl ...
- NHibernate 映射关系
基本映射关系如下: NHibernate类型 .NET类型 Database类型 备注 AnsiChar System.Char DbType.AnsiStringFixedLength - 1 ch ...
- "is not allowed to connect" mysql
好像过几次,安装mysql时,总会遇到这个问题. 每次都忘怎么解决. 这回写下来吧. 编辑 mysql数据库的 user表太麻烦了, 最简单的方法是加一个用户,以后就用这个用户登录 CREATE US ...
- codeforces 1042d//Petya and Array// Codeforces Round #510 (Div. 2)
题意:给出一个数组,求其中和小于t的区间数. 先计算前缀和数组sum[i].对当前的sum[i],查询树状数组中有几个比(sum[i]-t)大的数,那么用sum[i]减它就是一个合法区间.再将当前的s ...
- Golang中defer、return、返回值之间执行顺序的坑
原文链接:https://studygolang.com/articles/4809 Go语言中延迟函数defer充当着 cry...catch 的重任,使用起来也非常简便,然而在实际应用中,很多go ...