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

 

郑重声明:本站内容如果来自互联网及其他传播媒体,其版权均属原媒体及文章作者所有。转载目的在于传递更多信息及用于网络分享,并不代表本站赞同其观点和对其真实性负责,也不构成任何其他建议。