0

To do the above task manually we can go to the Site Actions -> Site Settings -> Site Collection Administration -> Content Type Publishing and checked the Refresh all published content types on next update. My question is how do I do the same thing via Powershell.

Thanks.

4 Answers 4

0

There's no easy simple command. But to have some understanding on the architecture of this settings and make your own powershell function check out this article.

4
  • I usually googled a lot to find solution for my problem. If I can't find it, only then I will ask my question here. So, I've been to that site before posting my question. Anyway, thanks for trying to help me. Oct 10, 2012 at 8:16
  • So with the help of that post u could not solve your problem? Can you please elaborate what's the problem you are hitting presently?
    – Diptarag
    Oct 10, 2012 at 8:18
  • Is there a cmdlets that can set the the Refresh all published content types to true. (checkbox is checked) Oct 11, 2012 at 5:39
  • 1
    This answer is accepted but it doesn't provide details and the link is dead.
    – shufler
    Jan 9, 2019 at 23:50
1

Why not just publish the specific content types?

Eg

$site = $contentType.ParentWeb.Site
$publisher = New-Object Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher $site
$publisher.Publish($contentType)

# Start timer jobs
Start-SPTimerJob -Identity "MetadataHubTimerJob"
Get-SPWebApplication | Get-SPTimerJob -Identity "MetadataSubscriberTimerJob" | Start-SPTimerJob
0

There is a product out there that publishes content types of your choice automatically with a click of a button (instead of the manual steps and effort that is currently required): http://www.xstreamsoftware.com/SharepointAutoContent.htm

0

you need to update a property bag on the root site of the site collection http://www.sharepointvoodoomagic.com/2011/07/refresh-all-published-content-types-on.html

Function RemoveAllTimeStamps([Microsoft.SharePoint.SPSite] $site)
{
    if ($site -eq $null) { return }
    $rootWeb = $site.RootWeb
    if ($rootWeb.Properties.ContainsKey("MetadataTimeStamp"))
    {
        $rootWeb.Properties["MetadataTimeStamp"] = [string]::Empty
       $rootWeb.Properties.Update()
    }
}
$webApp = Get-spWebApplication <web app url>

$webApp.Sites | % {
    $site = $_
    RemoveAllTimeStamps $site
    $site.Dispose()
}
3
  • This does not provide an answer to the question. To critique or request clarification from an author, leave a comment below their post. - From Review
    – Gaurravs
    Mar 30, 2017 at 11:09
  • setting the property bag "MetadataTimeStamp" with powershell to an empty string on the site collection is the same as clicking on "Refresh all published content types on next update", the site coll is then picked up by the CT publishing service, question answered ;-)
    – dc2009
    Mar 31, 2017 at 13:39
  • The question isn't answered because your answer provides no details about how to set the MetadataTimeStamp to an empty string.
    – shufler
    Jan 9, 2019 at 23:49

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.