SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When using the stsadm -o execadmsvcjobs as part of a batch command we are finding that even though the command is saying all the jobs have been run, the jobs haven't necessarily completed.

This means that our next batch job for example activate feature may fail as the solution has not been deployed in time.

We have a delay in the batch file currently to solve this but would like to know if there is a better solution.

all the best

share|improve this question
up vote 2 down vote accepted

EASJ has several issues.

First of all, there is no guarantee that the deployment succeded after running EASJ. You will have to call ENUMSOLUTIONS and parse the XML returned to see if the deployment wen well.

Secondly, EASJ only checks for jobs in the SPAdministrationServiceJobDefinitionCollection of the current Web Front End server. This is probably what is causing you grief when you activate features: the job might be finished on current WFE, but not on all WFE. Another variation of this is that if you have deployed solutions earlier on WFE#1 and that job somehow was stalled, and you re-deploy the solution on WFE#2 you will get weird warnings about pending jobs etc. This is why it is important to always deploy from the same WFE!

STSADM extension guru and MVP Gary Lapointe has made an extension that should address the later problem, and hence be safe(r) to use in scripts:

AFAICS he doesnt address the fact that a deployment could occur during deployment though.

About the PowerShell solution: while it sounds attractive, it could become complex quite fast (we have created a deployment solution in PowerShell and trust me it was no picknick). Also alot of the logic regarding deployment are internal classes (such as SPTimerStore). It is definately doable, though :-)

share|improve this answer

Your Answer


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