Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

SharePoint 2010: Is it possible to replace content type from existin libraries?

Posted on 2013-11-25
3
Medium Priority
?
577 Views
Last Modified: 2013-11-26
Hello. I have multiple document libraries with custom content type (content type hub). I would like to replace existing content type with my fancy new content type.  Is it possible to create ps1/c# code that would do this? Should I expect problems? I guess SharePoint may not allow my code to remove existing content type.
0
Comment
Question by:tolppa
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 32

Accepted Solution

by:
Jamie McAllister MVP earned 1000 total points
ID: 39673974
In this thread I posted some code to change content types; http://social.msdn.microsoft.com/Forums/sharepoint/en-US/e61f920c-b9ba-44a9-8502-3243621bcdc8/adding-a-content-type-document-to-manyall-libraries-in-a-site?forum=sharepointgenerallegacy

This is managed code rather than powershell, but it can be adapted.
0
 
LVL 9

Assisted Solution

by:vaderj
vaderj earned 1000 total points
ID: 39675512
You can have two content types assigned to a list.  You will not be able to remove the original content type of that list if there are any list items that are using that content type.
You can switch a list items content type via the list item properties, or you can also do this via code / PoSH script
0
 
LVL 1

Author Closing Comment

by:tolppa
ID: 39679882
Thanks.
0

Featured Post

Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will be converting StringData saved within a text file into a hash table. This can be further used in a PowerShell script for replacing settings that are dynamic in nature from environment to environment.
A walk-through example of how to obtain and apply new DID phone numbers to your cloud PBX enabled users that are configured in Office 365. Whether you have 1, 10 or 100+ users in your tenant, it's quite easy to get them phone-enabled and making/rece…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an antispam), the admini…
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

597 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question