3

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#

2 Answers 2

1

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;
                                   }
0

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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