powershell 操作sharepoint命令集

打开SharePoint 2013 Management Shell, and then run as administrator.执行如下命令

1. 添加wsp和安装
Add-SPSolution -LiteralPath "C:\DeployResource\WSP\test.wsp"
Install-SPSolution -Identity "test.wsp" -WebApplication "http://domain:port/" -GACDeployment -Force

如果是无资源安装则去掉-WebApplication "http://domain:port/"

2. 更新wsp:Update-SPSolution -Identity SPListUpdateAD.wsp -LiteralPath "D:\BackupOfBackup\Release_20141010\WSP\SPListUpdateAD.wsp" -GACDeployment

3. 备份wsp:Get-SPSolution | Where {$_.Name -eq "SPListUpdateAD.wsp" } | ForEach-Object{ $_.SolutionFile.SaveAs("d:\Backwsp\"+$_.Name)}

4. 移除wsp,需要先在CA>System Settings>farm solution>retract 该wsp,在执行下面powershell script
Remove-SPSolution -Identity "hkexsitewakeuptimerjob.wsp" -Confirm:$false

5. 移除timer job

$job = Get-SPTimerJob -id 3219759c-c748-444c-9ed7-bb3afb17fc9f
$job.Delete()

6. 查询timer job
Get-SPTimerJob | where { $_.name -like “*HKEx*” } |ft id,name

7. 激活feature
Enable-SPFeature -Identity "SharePointWebPartProject_SharePointWebPartFeature" -Url http://www.contoso.com
8. 禁用feature
disable-SPFeature -id 1563deb1-0c37-481c-9463-f3581e720897 -Url http://www.contoso.com  -Url http://www.contoso.com

 

转载于:https://www.cnblogs.com/leixb/p/4063147.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值