none
Add a content type to a docset (powershell) RRS feed

  • Question

  • I am creating content types for my site with powershell. 

    I need to create a docset content type.

    I can't figure out how to add content types to the set of allowed content types 

    I've found the $CT.XmlDocumets collection which contains a document of the docset: 

    <act:AllowedContentTypes xmlns:act="http://schemas.microsoft.com/office/documentsets/allowedcontenttypes" LastModified="02/1
    6/2017 21:57:59"><AllowedContentType id="0x0101" /></act:AllowedContentTypes>

    The property seems to be read only.

    How do I do this? 



    Friday, February 17, 2017 1:17 AM

Answers

All replies

  • please check this options

    https://social.technet.microsoft.com/Forums/en-US/eb41ddb6-e678-442a-95e5-0614275c85ec/create-bulk-document-sets-using-powershell-in-sharepoint-online-2013-office-365?forum=sharepointadmin


    Please remember to click Mark as Answer on the answer if it helps you

    Friday, February 17, 2017 6:38 AM
  • please check this options

    https://social.technet.microsoft.com/Forums/en-US/eb41ddb6-e678-442a-95e5-0614275c85ec/create-bulk-document-sets-using-powershell-in-sharepoint-online-2013-office-365?forum=sharepointadmin


    Please remember to click Mark as Answer on the answer if it helps you

    Thanks Lakshmanan. 

    That's not quite what I am looking for. The link discusses how to create instances of a docset, whereas I am looking to change the definition of the docset. 

    ie I have a DocSet called 'Employee' which has allowed content type of 'Document', in my SP site I have created a content type from document called 'Job Description'. I want to add that new CT to the set of allowed content types for my Employee. 

    Site Settings > Content Types > [My Doc Set] > Document Set Settings

    

    Friday, February 17, 2017 5:33 PM
  • Hi,

    The Add-PnPContentTypeToDocumentSet of SharePointPnP.PowerShell Command would help, you could check below link for details.

    https://github.com/SharePoint/PnP-PowerShell/blob/master/Documentation/AddPnPContentTypeToDocumentSet.md

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, February 20, 2017 1:43 AM
  • Hi,

    Could you provide any feedback for your issue?

    Best Regards,

    Lee


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Wednesday, February 22, 2017 9:51 AM
  • Hi,

    That is an excellent framework!!!!

    Does what I need and do much more. Thanks.

    Thursday, February 23, 2017 4:12 AM
  • Hi,

     

    You could mark the replies as answers if the replies helped you, so it may help others who has similar requirement.

     

    Best Regards,


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Thursday, February 23, 2017 5:07 AM
  • Done.

    I've 'Marked as Answer' 

    Arguably it is not an answer to my question, but the framework allows me to do it very easily - so I'm happy. I guess if I was so inclined I could examine to github code to find out how it is done through the SP APIs.

    Thursday, February 23, 2017 5:42 PM