mike hodnick

Point your browser to www.hodnick.com for Mike's latest content.

Notice:

You are viewing Mike's old, archived site. For new content, navigate to hodnick.com

Latest From Twitter...

The Blog

This is arguably one of the easiest tasks you can perform in code as a SharePoint developer, but not very well known or documented.  Start off by referencing the Microsoft.SharePoint.Publishing assembly.  The rest is cake:

// assume we're using the
// Microsoft.SharePoint.Publishing.Administration namespace

ContentDeploymentJobCollection jobs = ContentDeploymentJob.GetAllJobs();

foreach (Job job in jobs)
{
  Console.WriteLine(job.Name);
  job.Run();
}

The ContentDeploymentJob class also has a GetAllQuickDeployJobs() method to return only Quick Deploy jobs.

The ContentDeploymentJob class hosts the expected methods and properties you'd find on a job, such as Name, Description, LastStatus, Run(), and Test() (among others).

Technorati Tags:
posted on Thursday, September 18, 2008 8:54 AM |