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

I need to detect if a content deployment between two different sharepoint 2010 farms is finished. Is there a way to achieve this programmatically? I've been looking around for some days now but without success.

Are there any Event-Handlers or CustomActions I can use? At the moment I'm building my own deployment job using SPImportand SPExportbut that seems many overhead for me. All I need to do is to execute a simple function when the content deployment is finished.

Thank you very much! LMW

P.S. I'm using Sharepoint2010 and VS2010/C#

share|improve this question
add comment

2 Answers

up vote 1 down vote accepted

You have to check the ContentDeploymentJobStatus until it returns "Success". You can use code like below.

ContentDeploymentJobCollection cdJobCollection = ContentDeploymentJob.GetAllJobs();

                                   foreach (ContentDeploymentJob job in definitionCollection)
                                   {
                                       if (job.Name.StartsWith(strYourJobName.ToLower()) && job.LastStatus==ContentDeploymentJobStatus.Success)
                                       return true;
                                   }
share|improve this answer
add comment

What you can do is to send the success / error email to an email enabled SharePoint list. In that list you'll have a receiver on item added that can execute some code on the site collection / web app / farm ... depending on the elevation / work to be executed.

You could also do a little bit of screenscrapping on the central administration dashboards but that it's even clumsier than the first suggested solution.

Kindly

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.