Monday, 2 August 2010

Use PowerShell to push changes from Content Type Hub to Site Collections in SharePoint 2010

Quite a simple one this, but also a time saver. If you are in the process of adding site columns and content types to a Content Type Hub, it can take up to one hour for the timer jobs to run to distribute the changes to your site collections, which is sensible for maintaining performance, but a pain if you are making lots of changes and want to see them in your site collections straight away.

In SharePoint 2010, you can now run your timer jobs manually from the UI in Central Administration, but this can still be pain as you have to run the Content Type Hub job, followed by the Content Type Subscriber job for each Web Application receiving the changes – quite a few clicks!

The PowerShell script below allows you to do this a lot quicker as you can just keep running it every time you make a change:

#Run the Content Type Hub timer job
$ctHubTJ = Get-SPTimerJob "MetadataHubTimerJob"
$ctHubTJ.RunNow()

#Run the Content Type Subscriber timer job for a specific Web Application
$ctSubTJ = Get-SPTimerJob "MetadataSubscriberTimerJob" -WebApplication http://portal
$ctSubTJ.RunNow()

I’ll be following this with a script in a future post to show you how you can publish and republish content types inside the Content Type Hub site collection itself.

33 comments:

  1. Thanks for the post.

    Do you know how to enumerate through content types on your content type hub and set them to republish?

    ReplyDelete
  2. Hi - I have written a script for this today at http://get-spscripts.com/2010/11/republish-all-hub-content-types-in.html. Thanks for the suggestion

    ReplyDelete
  3. Great! This is exactly what I was looking for, thanks!

    ReplyDelete
  4. It is a time consuming process to locate a legitimate, high-quality designer Michael Kors Handbags On Sale at a decent price. One brand name that is sought after is the Michael Kors Bags On Sale. Anywhere you see high demand you will find people out to make a quick buck.

    ReplyDelete
  5. It is a time consuming process to locate a legitimate, high-quality designer Michael Kors Handbags Clearance at a decent price. One brand name that is sought after is the Michael Kors Outlet Store. Anywhere you see high demand you will find people out to make a quick buck.

    ReplyDelete
  6. Our digital marketing course in Chennai is targeted at those who are desirous of taking advantage of career opportunities in digital marketing. Join the very best Digital Marketing Course in Chennai. Get trained by an expert who will enrich you with the latest digital trends.

    Digital Marketing Course in Chennai
    Digital Marketing Training in Chennai
    Online Digital Marketing Training
    SEO Training in Chennai
    Digital Marketing Course
    Digital Marketing Training
    Digital Marketing Courses

    ReplyDelete
  7. Designer Exposure es un buen lugar para comprar su Bolsos Michael Kors original.
    The Woven Tote es también una selección impresionante en el Bolsos Michael Kors Baratos.
    Bolso de alta calidad que debe contemplar absolutamente un Bolsos Michael Kors Outlet.
    Du kommer att upptäcka en handfull detaljer som du kan förvänta dig att komma över på en vanlig Michael Kors Rea.
    Du kan hitta ett antal platser som ger Väska Michael Kors.
    Sortimentet är fantastiskt för alla som letar efter en MK Väska.
    Håll dina ögon öppna för den här säsongens val som kommer att presenteras under bara några månader och det kommer utan tvekan att bli spektakulärt.

    ReplyDelete
  8. También puede visitar una tienda de ladrillo y mortero de Michael Kors o su sitio web y comprar directamente un bolso Michael Kors desde allí. Usar un bolso de Michael Kors les permite a los demás reconocer que el habitante urbano educado toma la moda realmente con seriedad. Los bolsos de hombro son particularmente refinados y elegantes.

    {Bolsas Michael Kors Precios | Bolsos Michael Kors Outlet | Michael Kors Rebajas}

    En vacker konstnärlig skapelse av vävt läder, som ger ett skalskaligt utseende - liknar en snakeskin eller fiskhud, linjer utsidan av påsen. Läderens bältros är små läderringar. Det finns också gyllene accenter på väskan. Slutresultatet är svagt liknar kedjepost.

    {Michael Kors Rea | Michael Kors Väska Rea | Michael Kors Plånbok}

    ReplyDelete