Content Type Publishing - Limitations?

Hi,
I am running into some problems with the Content Type Publishing in SP2010.  
As background:
We have a farm with two SharePoint servers - one as WFE and one as App server.  A third shared SQL cluster hosts our databases
we are on SP2 for SP2010
We have Project Server 2010 also installed, also on SP2
We have 3 web applications - one as our Content Type hub, and two consuming web apps (http://content, http://epm and http://scm).  
The EPM Web App hosts our biggest site collection - roughly 150GB in size, and about 1900 sub webs
Our content hub hosts around 450 content types
We seem to have a problem with the sync never finishing.  We are not sure how long this has been the case - we only recently noticed it while trying to apply some changes to the Content Types.
the timer job gets to 5% and then stays there "Running".
I am not even not sure how to monitor for errors in the ULS logs - I cannot seem to find the source for this.  Its also difficult to enable Verbose logging for the entire time that it  is running as it takes so long  and causes our drives
to run out of space.
The question is, I suppose, does anyone else have experience in large situations like these? Are we perhaps running into a limitation?  Is there anything that we should, or should not, be doing?
Thanks!
http://blogs.umtsa.co.za/nicoo

Hi,
Please try using PowerShell to update content type hub subscribers per the link below:
http://blogs.msdn.com/b/aaronsaikovski/archive/2010/08/26/updating-content-hub-subscribers-using-powershell.aspx
If it still doesn’t work, please try alleviate the workload of timer job. You could update one web application one time, see if overburden causes the issue.
Or you could remove or unpublished most of the content types and see if that will make any difference. See the script below:
function f($ct)
try
$site = new-object Microsoft.SharePoint.SPSite "http://sps/sites/hub"
$ctpub = new-object Microsoft.SharePoint.Taxonomy.ContentTypeSync.ContentTypePublisher($site)
$site.rootweb.availablecontenttypes | foreach-object{if($_.name -eq $ct){$ctpub.unpublish($_);write-host $_.name; write-host $ctpub.IsPublished($_) }}
catch [Exception]
Write-Host "Issue"
Or you could turning off the subscription of the consuming site collection, i.e. because some site collections have many subsites. Test the command to disable the feature “disable-spfeature taxonomyfieldadded -url http://....” before.
Regards,
Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
[email protected] .
Rebecca Tu
TechNet Community Support

Similar Messages

  • How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?

    Dear SharePoint Developers,
    Please help.
    I need to know How to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx?
    I think this is a "sealed column", whatever that is, which is  shown in SPD 2013 as a column of content type "document, folder, MyCustomContentType".
    I know when I set the column order in my custom Content Type settings page, it is correct.
    But, when I load the NewDocSet.aspx page, the column order that I set in the settings page is NOT used for this "sealed column" which is bad.
    Can you help?
    Please advise.
    Thanks.
    Mark Kamoski
    -- Mark Kamoski

    Hi,
    According to your post, my understanding is that you want to set the column order of a sealed column in a custom Content Type for the new item form NewDocSet.aspx.
    Per my knowledge, if you have Content Type management enabled for the list or library (if you see a list of content type with the option to add more), the display order of columns is set for each content type.
    Drill down into one of them and you'll see the option under the list of columns for that content type.
    To apply the column order in the NewDocSet.aspx page, you need to:
    Select Site Settings, under Site Collection Administration, click Content type publishing. In the Refresh All Published
    Content Types section, choose Refresh all published content types on next
    update.
    Run two timer jobs(Content Type Hub, Content Type Subscriber) in central admin(Central Administration--> Monitoring--> Review timer jobs).
    More information:
    http://sharepoint.stackexchange.com/questions/95028/content-types-not-refreshing-on-sp-online
    Best Regards,
    Linda Li
    Linda Li
    TechNet Community Support

  • What is content type in SharePoint?

    Hi All,
    What is content type in SharePoint, i have seen so many content types like list content type, library content type and so many.
    Can any one explain?

    hi,
    A content type is a reusable collection of metadata (columns), workflow, behavior, and other settings for a category of items or documents in a Microsoft SharePoint
    Foundation 2010 list or document library. Content types enable you to manage the settings for a category of information in a centralized, reusable way.
    in basic terms Collection of columns is called content type.
    refrence:
    https://support.office.com/en-us/article/Introduction-to-content-types-and-content-type-publishing-e1277a2e-a1e8-4473-9126-91a0647766e5
    Whenever you see a reply and if you think is helpful,Vote As Helpful! And whenever you see a reply being an answer to the question of the thread, click Mark As Answer

  • Orphaned column in a content type

    Hi,
    We have MMS and Content Type Hub created.
    Initially we created a column and added it to a couple of content types in the Content Type Hub and published the content types.
    Recently we deleted the column from one particular content type and republished the content type, but still we see the column in the content type in the subscribing site collections New and Old.
    Have manually run the jobs "Content Type Hub" and "Content Type Subscriber"

    Hi,
    According to your post, my understanding is that the content type in the subscribing site collections don’t update immediately.
    I recommend that you can try to check and test the things as below:
      1.  Go to “SharePoint 2013 Central Administration”, click on the “Application Management”, click on the “Manage Service Application”, select “Managed Metadata Service Application”, check the Managed metadata service connection properties to make
    sure that the option “Consumes content types from Content Type gallery at <your correct Content Type Hub URL>” and “Push-down Content Type Publishing updates from the Content Type Gallery to sub-sites and lists using the content type” is enabled.
      2.  Go to “Site Settings”, click on the “Site content types”, select the particular content type, click on the “Manage publishing for this content type”, check the “Unpublish” button and click on the “OK” button, then you need to publish it again.
      3.  Go to “Site Settings”, click on the “Content Type Publishing” to check the “Refresh all published content types on next update” and the “the Content Type Publishing error log”.
      4.  Go to “Monitoring” in the “SharePoint 2013 Central Administration”, click on the “Review job definitions”, find the
    “Content Type Hub” and “Content Type Subscriber” timer jobs to run again, and check if the two timer job’s status is succeeded.
    For more information, you can refer to:
    http://blog.morg.nl/2011/11/content-type-hub-not-working-possible-causes/
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/248fcf93-5ebe-4404-8b7d-f1f32d0046e3/content-type-hub-syndication-and-publishing-works-but-not-for-already-applied-content-types?forum=sharepointgeneral
    https://support.office.com/en-US/Article/Publish-a-content-type-from-a-content-publishing-hub-58081155-118d-4e7a-9cc5-d43b5dbb7d02?ui=en-US&rs=en-US&ad=US
    http://sharepoint-community.net/profiles/blogs/understanding-content-type-hub-cth-in-sharepoint-2013
    Best Regards,
    Yumi Fu

  • InfoPath 2010 - How to connect to another content type form from the current form with a click of a button?

    I have two different form library forms for each different content type published to the same Form Library.  I like to know if by a click of a button, if I could close the current form and jump to the next and vice versa? If so, what steps
    would I need to take using OOB technology?
    Thank you,
    SRAEngineer

    Hi Guru:
    Thanks.  However, the Views do not work in my case, as one form has different required fields than the other and set of fields also changes a bit for each form.
    However, researching more I have been able to find the solution since I posted this request.
    I will try to describe the Solution:
    First I deployed both the forms to a SharePoint Form Library. Then I opened the template from the advanced settings and copied the URL from the top search box of IE.
    Went back to the design view of the form, highlighted the writings/title of the form and right clicked to paste the hyperlink.
    Quick published it again and now the hyperlink is working active/live in the deployed form as well and doing its job to get to the next form. I repeated the process to the other form to do a toggle.
    Thank you for your input though.
    Regards,
    SRA
    SRAEngineer

  • Incorrect Infopath content type update in form library after modifying Infopath form and publish it

    I have an admin approved InfoPath form. I added new fields to that form and mapped those new fields with site columns. After uploading updated published form through CA, I noticed InfoPath Site content type for that form got updated (with newly added fields)
    under Microsoft_Infopath group. This content type is also added in form library but somehow the new fields are updated incorrectly for this content type existing in form library (it doesn't show new fields, and shows one new field which is incorrectly
    mapped with other column this is happening only in library). 
    Things I tried:
    - Activate/Deactivate that content type feature
    - Deactivated feature, removed form from CA, re uploaded and activated feature
    - Removed those new fields and published and uploaded InfoPath form and then added those new fields and published and uploaded again.
    -Deleted those fields from InfoPath and readded new fields and published and uploaded form but still the problem persists.
    Any help will be appreciated.
    Dhaval Raval

    Hi Thanks for the response,
    But Update all content types inheriting from this type is already checked.
    That form library has multiple content types associated with it , different infopath forms get submitted there. What I noticed is that when I change the form and publish it, its corresponding site content type gets updated but the same content type used
    in form library doesn't get updated properly. I went to form library and checked that erroneous content type, there were some columns missing and one column was mapped incorrectly. When I clicked on "Parent" content type, it was showing all the new Infopath
    fields(updated content type). So I figured that Infopath site content type was getting updated correctly but it was not able to propagate those updates (in a correct way) to the form library. I also tried to edit that content type and tried adding existing
    site columns which were missing but surprisingly it was not showing those site columns either, which were mapped from Infopath publishing.
    The cause for this behavior is : changes/updates to the Infopath content type are not getting propagated to the form library and this is happening for only one infopath content type but other Infopath content types are getting updated.
    I had to delete all the forms using that erroneous content type and then had to delete that content type from the library and then re-added that Infopath content type to the library and this time it was having correct content type (updated columns).
    This is not a perfect solution for the production environment, sounds like it is a bug.
    Dhaval Raval

  • Creating the site content type failed when publish Infopath form to Sharepoint 2013

    I have an InfoPath 2013 form trying to publish it to SharePoint 2013.  When I click on publishing an error message appears stating "Creating the site content type failed".  I can't figure out why this
    is happening, any help on this one?
    Also it appears the form template is uploaded when I go to the library settings under advance.  When I see the .xsn file and click on it, it opens in InfoPath but not in sp.

    Rettajm, could you please find any errors in ULS?

  • Publishing Content Types from Hub in Bulk

    I am able to publish content types from the hub just fine. However, I am in a migration scenario where over 1500 content types are being migrated to SharePoint Online from SP2013. We have successfully migrated these to the content hub, managed metadata stores,
    etc. However, when they are migrated, the publish property does not migrate with it.
    On-Premises, we could publish all of these with PowerShell so they could be consumed by the syndicated sites. Is there a way to publish all of these so that we don't have to go into each once via the UI?

    Depends who you give access too. What I'd consider doing is making a copy of what you consider to be the template for the rest of the content types, save that to a unique category within the list of content types and then build the rest off that. Show the
    client how to make changes to JUST that template and in theory you'll be fine.
    Or, are the content types in use already?
    Steven Andrews
    SharePoint Business Analyst: LiveNation Entertainment
    Blog: baron72.wordpress.com
    Twitter: Follow @backpackerd00d
    My Wiki Articles:
    CodePlex Corner Series
    Please remember to mark your question as "answered" if this solves (or helps) your problem.

  • Mapping exisitng content type to a publishing site programatically

    Hi All,
    I have created a site content type manually(Publishing Content type).
    I need to add this content type and populate respective columns programmatically to a publishing site.
    Pls help.
    Thanks in advance
    Patsy

    Hi,
    I just wanted to check, publishing site and content type both are in same web application?
    Sekar - Our life is short, so help others to grow
    Whenever you see a reply and if you think is helpful, click "Vote As Helpful"! And whenever
    you see a reply being an answer to the question of the thread, click "Mark As Answer

  • How to publish workflows created under content type to make it available in all my-sites.

    Hi,
        i followed this procedure to publish workflows in my-sites but even after activating workflow feature am unable to get created workflow templates in my-site.
    Create a workflow and associate it with your content type in the hub.
    Before publishing this content type, export the reusable workflow and import it in all the subscriber site collections or deploy your workflow to the farm if it is a farm solution
    Activate your workflow feature
    Now, your workflow is available in the hub as well as all the subscriber site collections.
    Publish the content type. The workflow association will be publish.
          can anyone help me out of this issue. 

    Hi,
    As I understand, you encountered the issue after activating workflow feature.
    Per my test, I can get the created workflow templates
    after activating workflow feature by workflow 2010.
    1. Check if you use SharePoint 2010 workflow because SharePoint 2013 workflow doesn’t work.
    2.  Reactive the workflow template feature in your site collection.
    3. If it still doesn’t work, open the site collection you want to use the workflow in the SharePoint designer and associated the workflow with the content type in the site collection. After these steps, you can use workflow in your all site collection.
    There is a similar thread:
    https://social.technet.microsoft.com/Forums/office/en-US/714d1e48-a31d-4daa-9572-62d56c3b8c93/create-workflow-for-content-type-which-can-be-accessed-as-a-template-in-all-sites-including-mysite?forum=sharepointadmin
    Best regards,
    Sara Fan

  • Publishing Content Type InfoPath Form in different Forest

    Hello,
    I created new SharePoint Farm in new Forest in our organization. (We are moving current SharePoint Farm to a different Forest. ) I restored Site collections in new farm.
    I have custom InfoPath Forms published as a Content Type. I carried data connections to a new farm.
    When I'm re-publishing as a content type (update or new), I'm seeing messages below. My InfoPath works without issues, but I'm not happy with these messages. What is the best solution to carry Content Type InfoPath Form to another SP Farm in another Forest?
    How can I fix this issue?
    Thank You
    Unable to locate the xml-definition for FieldName with FieldId '1c41556d-d252-4abf-adf8-02863dc8c0e0', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException
    (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))    
     at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)     -
     -- End of inner exception stack trace ---    
     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.SPFieldCollection.FetchFieldsFromWeb()
    Unable to locate the xml-definition for CType with SPContentTypeId '0x0108000F14551F35854DE7B72671CB134FBCF9', exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException
    (0x8000FFFF): Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))    
     at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)     -
     -- End of inner exception stack trace ---    
     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.SPContentTypeCollection.FillCollection(SPRequest req, SqlDataReader rdr, Boolean openWeb)
    Unable to locate the ghosted xml-definition for field template, exception: Microsoft.SharePoint.SPException: Catastrophic failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED)) ---> System.Runtime.InteropServices.COMException (0x8000FFFF): Catastrophic
    failure (Exception from HRESULT: 0x8000FFFF (E_UNEXPECTED))    
     at Microsoft.SharePoint.Library.SPRequestInternalClass.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)     -
     -- End of inner exception stack trace ---    
     at Microsoft.SharePoint.SPGlobal.HandleComException(COMException comEx)    
     at Microsoft.SharePoint.Library.SPRequest.GetGlobalContentTypeXml(String bstrUrl, Int32 type, UInt32 lcid, Object varIdBytes)    
     at Microsoft.SharePoint.SPContentType.FetchFieldsXmlFromWeb(SPChunkedStringBuffer csb)

    I understand that you cannot publish a form to a form library as the form template is checked out. You can open the site in SharePoint designer. Open the form library in All Files folder. The template is stored in the Forms folder. You need to check whether
    this file is checked out. If yes, you need to check it in. If not, you can try to edit the form template in this way:
    Open the form library in browser and open library settings.
    Click on the form content type and modify the Advanced Settings for the content type.
    Here you can click Edit Template link to edit the form template in InfoPath designer. Try to publish the form back to the library again to see whether the issue persists.
    Courtesy: Entan
    Ming
    Please 'propose as answer' if it helped you, also 'vote helpful' if you like this reply.

  • Error message while checking in Publishing page with custom content type.

    Hi,
    We have a custom page layout created from a custom content type. We have dragged some "Mandatory fields" on to the page.
    Even if i add all the fields on the page and click on check in, we are still getting the below error :
    "You must fill out all required properties before checking in this document."
    Regards,
    Amit

    Hi,
    We have a custom page layout created from a custom content type. We have dragged some "Mandatory fields" on to the page.
    Even if i add all the fields on the page and click on check in, we are still getting the below error :
    "You must fill out all required properties before checking in this document."
    Regards,
    Amit

  • Cannot add hub-managed content type with external list lookup columns to a list -- Error:Id field is not set on the external data field

    This is a variation on the issue mentioned in this
    post
    We are using SP 2010 Content Hub to manage our content types.  On the content hub we've created a couple of exteranl lists, and then created some site columns as lookups against these lists.  We then added the columns to one of our content types
    and set it to publish.
    After the publishing job executed, I tried adding the content type (which now appears on the subscriber sites) to one of the document libraries on one of the subscriber sites.  When I did that it threw the following error:
    Microsoft.SharePoint.WebControls.BusinessDataListConfigurationException: Id field is not set on the external data field    
    at Microsoft.SharePoint.SPBusinessDataField.CreateIdField(SPAddFieldOptions op)     
    at Microsoft.SharePoint.SPBusinessDataField.OnAdded(SPAddFieldOptions op)     
    at Microsoft.SharePoint.SPFieldCollection.AddFieldAsXmlInternal(String schemaXml, Boolean addToDefaultView, SPAddFieldOptions op, Boolean isMigration, Boolean fResetCTCol)     
    at Microsoft.SharePoint.SPContentType.ProvisionFieldOnList(SPField field, Boolean bRecurAllowed)     
    at Microsoft.SharePoint.SPContentType.ProvisionFieldsOnList()     
    at Microsoft.SharePoint.SPContentType.DeriveContentType(SPContentTypeCollection cts, SPContentType& ctNew)     
    at Microsoft.SharePoint.SPContentTypeCollection.AddContentTypeToList(SPContentType contentType)     
    at Microsoft.SharePoint.SPContentTypeCollection.AddContentType(SPContentType contentType, Boolean updateResourceFileProperty, Boolean checkName, Boolean setNextChildByte)     
    at Microsoft.SharePoint.SPContentTypeCollection.Add(SPContentType contentType)     
    at Microsoft.SharePoint.ApplicationPages.AddContentTypeToListPage.Update(Object o, EventArgs e)     
    at System.Web.UI.WebControls.Button.OnClick(EventArgs e)     
    at System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument)     
    at System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument)     
    at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)    b55297ed-717f-466d-8bdc-297b20344d3f
    I checked the external  content type configuration and it did specify an "id column".  Anyone know if what I am attempting to do is possible and if so, what special configurations are required?
    Thanks

    The issue is not External Content type or external list but the look up column.
    It's not possible to publish a look up column via the Content Type Hub.
    If you need to do this then an alternate way is to use a Managed Metadata column instead, otherwise you will have to implement this via a feature.
    Varun Malhotra
    =================
    If my post solves your problem could you mark the post as Answered or Vote As Helpful if my post has been helpful for you.

  • Look up column in Content Type Hub

    Hi,
     Would like to know whether look up columns are  supported /not supported in content type hub.
     Currently I am having few columns in my doc.libs which uses look up column and i want to implement content type hub.
    heard that this is a limitation in CTH.
    Can anyone from MS pls confirm.
     and at the same  time if I want to use the look up column functionality and implement CTH, any alternatives available.
    help is  highly appreciated!

    Hi,
    Please refer to the following article, it might help
    Content Type Hub Sync & Lookup lists
    And also refer to the following post.
    Content Type Hub Syndication and lookup site column within a content type
    Please mark it answered, if your problem resolved.

  • Deploying a Reusable Workflow to a List Content Type using PowerShell

    We have a situation where deployment of a reusable workflow for a site content type cannot be completed through the web interface due to the number of libraries where the content type is in use (time-out on deploy and update).
    It was hoped that this could be accomplished with PowerShell but the method of deploying to a list content type appears to be different than it is to a list (all content types).
    The below snippet works fine for a list / all content types:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.AddWorkflowAssociation($association)
    $_.Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    However changing the association as follows causes the script to still execute without a problem but the workflow doesn't appear for the content and the associations collection is empty:
    function AddWorkflowToLibraries ($SiteCollection, $ctName, $WfName, $WfAssociationName)
    $site = Get-SPSite $SiteCollection
    [Guid]$wfTemplateId = New-Object Guid
    #Step through each web in site collection
    $site | Get-SPWeb -limit all | ForEach-Object {
    $web = $_
    $_.Lists | ForEach-Object{
    if($_.AllowContentTypes -eq $true)
    if($_.ContentTypes.Item("$ctName") -ne $null)
    write-host "Enabling workflow on" $_.Title "in" $_.ParentWebUrl
    $ct = $_.ContentTypes[$ctName]
    $culture = New-Object System.Globalization.CultureInfo("en-US")
    $template = $site.RootWeb.WorkflowTemplates.GetTemplateByName($WfName, $culture)
    if($template -ne $null)
    $tasklist = "Tasks"
    $historylist = "Workflow History"
    if(!$web.Lists[$historylist])
    $web.Lists.Add($historylist, "A system library used to store workflow history information that is created in this site. It is created by the Publishing feature.",
    "WorkflowHistory", "00BFEA71-4EA5-48D4-A4AD-305CF7030140", 140, "100")
    if (!$web.Features["00BFEA71-4EA5-48D4-A4AD-305CF7030140"]) {
    Enable-SPFeature -Identity WorkflowHistoryList -Url $web.Url
    $wfHistory = $web.Lists[$historylist]
    $wfHistory.Hidden = $true
    $wfHistory.Update()
    if(!$web.Lists[$tasklist])
    $web.Lists.Add($tasklist, "This system library was created by the Publishing feature to store workflow tasks that are created in this site.", "WorkflowTasks", "00BFEA71-A83E-497E-9BA0-7A5C597D0107", 107, "100")
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    else
    Write-Error "Workflow Template not found"
    AddWorkflowToLibraries <Site Name> <Content Type Name> <Workflow Template Name> <Association Name>
    The only change is:
    $association = [Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($template, $wfName, $web.Lists[$tasklist], $web.Lists[$historylist])
    $association.AllowManual = $true
    $_.ContentTypes[$ctname].AddWorkflowAssociation($association)
    $_.ContentTypes[$ctname].Update()
    But unlike the list version, the association doesn't appear to be saved and no error is generated.
    Is anyone aware of what may cause this or have an example in C# that may explain something my script is missing?

    Hi Garry,
    After you associate the workflow to the content type, you should update the update the content type using
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
     method.
    Here is the completed script:
    [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint")
    $site=Get-SPSite "http://serverName"
    $web=$site.OpenWeb()
    $list=$web.Lists["ListC"]
    $taskList=$web.Lists["Tasks"]
    $historyList=$web.Lists["Workflow History"]
    $ct=$list.ContentTypes["Link"]
    $culture=New-Object System.Globalization.CultureInfo("en-US")
    $wfTemplate=$web.WorkflowTemplates.GetTemplateByName("Three-State",$culture)
    $associationWF=[Microsoft.SharePoint.Workflow.SPWorkflowAssociation]::CreateListContentTypeAssociation($wfTemplate, "myThreeStateWF",$taskList,$historyList)
    $ct.WorkflowAssociations.Add($associationWF)
    $ct.UpdateWorkflowAssociationsOnChildren($true,$true,$true,$false)
    Here is a demo about how to update it using C#
    http://www.thorntontechnical.com/tech/sharepoint/sharepoint-2010-associate-workflow-to-content-type-in-a-feature
    Wayne Fan
    TechNet Community Support

Maybe you are looking for