Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

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?

share|improve this question
add comment

3 Answers 3

up vote 2 down vote accepted

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

share|improve this answer
add comment

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.

share|improve this answer
add comment

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)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.