mike hodnick -> mhodnick <-> kindohm

Mike Hodnick is a geeky consultant guy living in Chaska, MN. He enjoys writing code, writing music, and doing fun stuff with his wife and daughter. This is his personal website, where you can get to his blog, music library, and other nonsense.

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 |

Comments

No comments posted yet.
Post Comment
Title *
Name *
Email
Url
Comment *  
Please add 5 and 7 and type the answer here: