문제

Is there a way to know if there is any active solution deployment running on SharePoint server? I'm wondering how to do this using a PowerShell script?

도움이 되었습니까?

해결책

You can only do this via stsadm -o enumdeployments because enumdeployments will list all the active deployments. Moreover, enumdeployments doesn't have PowerShell equivalent (at least that I can find so far). I got 98% of this information from Technet and a little from SharePoint forums

다른 팁

There is a more fail-safe approach than what @lwbecker2 suggests

Get-SPSolution | ? { $_.JobExists } | % { Write-Host "Deployment job is currently running" }

This has the benefit of not having a race condition. If you only look for the timer job, it may be that a deployment has already been initiated, but a timer job was not yet created when you check for it. I've had this happen to me consistently on servers with limited resources, where you start the deployment and check immediately after but the timer job did not yet exist.

There is no direct equivalent for stsadm -o enumdeployments, but since the deployments are run by Timer Jobs you can query and filter the running timer jobs to achieve your desired result:

From : Enumberate(sic) running Deployments using PowerShell

$list = Get-SPTimerJob | ?{$_.Name.IndexOf("solution-deployment") -ne -1)

If you know the name of your solution for example foo.wsp you can issue a more specific query

$list = Get-SPTimerJob | ?{$_.Name.IndexOf("solution-deployment-foo.wsp-0") -ne -1)

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top