1
vote
0answers
25 views

Can't update SPField through PowerShell - object has been updated by another user since it was last fetched

I get the following error when trying to update the choices for a Site Column: "The object has been updated by another user since it was last fetched." I get this error if I try to add a new choice ...
0
votes
1answer
13 views

How do I get a content type's parent name via powershell?

I am attempting to write a powershell script to pull content type names applied to lists, and their respective parent content type name. Unfortunately, I seem to have run into a hurdle - whenever I ...
0
votes
2answers
25 views

How can I find out if a column is unused powershell

I have noticed in some of my document libraries that I have a column that is unused. Is there a bit of code in powershell that will tell me which document libraries have the column in question but it ...
1
vote
1answer
83 views

How to AddItem with certain ContentTypeID using PowerShell

I am using PowerShell to add 100 items which need to be of a specific ContentType. (requirement) Test my custom events receiver using powershell. The test is to create a list with a custom content ...
0
votes
1answer
54 views

Export root site content types and selected properties to csv

I want to recreate a clients' ct structure using VS2012 so some cts and their guids I did have a go but it would be nice only to add the properties I want to my csv file rather than whole lot.. Any ...
1
vote
2answers
983 views

Content type ID on a file different from actual content type ID?

Moving from "a sharepoint user" to "a sharepoint power user", I now am facing the world of Powershell and more. One thing that really puzzles me is the following. Ok, so I have a document library ...
0
votes
3answers
4k views

Add field to List Content Type using Powershell

I'm updating predefined content types with 2 new field, but I have to set the ContentType.Update(false,false). Which means that it will not propagate the changes to the list content type (instances ...
3
votes
1answer
95 views

Hide SPContenType in use

I'm trying to hide (or remove it from the new button drop) a SPContentType that is already in use via Powershell scripting. Even if before: $SPContentType.Hidden = $true $SPContentType.Update() I ...
2
votes
4answers
3k views

How to set columns visible only in Display Form on a Column used by a Content Type

I have a column that we will call C. This Column is associated to a Content Type (CT). If I go to the properties of the CT -> Column C I can set the column to be Facoltative or Hidden: If I put it ...
1
vote
1answer
311 views

Adding a content type to a list gives me a duplicate field error

I have the following code: list.ContentTypes.Add(contentType); It works on my dev environment, but on test fails with the following error: A duplicate field name "[GUID]" was found. I've had ...
4
votes
1answer
6k views

How to update a deployed content-type?

I created a content-type and applied it inside a document library. Now, if I go to the conent-type gallery and delete one of the fields, and then go back to the library and view the available ...
2
votes
1answer
237 views

Programatically update field/column name in a list on all sub sites [Powershell]

What I want to do is with a Powershell script programatically go through all subsites in a site collection and change a column name in a list from "Web" to "Site". So in easier words: Go through ...
0
votes
1answer
195 views

How do I add a new ContentType using Feature Upgrading?

I have created a new Content Type. How do I publish it using Update-SPSolution and feature upgrading? I added the following Code to my Feature Manifest: <UpgradeActions> <VersionRange ...
0
votes
1answer
313 views

How to move content within fields in a page layout?

I'm working on a requirement where I'm adding a few fields in an already existing Page Layout and also renaming all the fields. After adding the fields via code,I want to move content within fields ...
2
votes
1answer
302 views

Is it possible to use powershell to change the content type of a page layout after its been uploaded to a masterpage gallery?

Im trying to automate as much of the upgrade I am working on and one of the manual steps is to change the page layout of 5 root webs of site collections, each of which has to have this new page layout ...
1
vote
3answers
7k views

How do I programatically change the content type of an existing file?

Is there some way to change the content type of a file using PowerShell? Ideally I'd like to write a function that one would point at a specific document library and it would pull down an array of ...
2
votes
1answer
1k views

How do you determine the Consumers for a given Content Type?

Is there a quick powershell script to find out all the consumers who are consuming a given content type? If yes, how do you do this with powershell?
4
votes
1answer
6k views

Adding a site column and add it to a content type from PowerShell issue

Within a PS script, I'm trying to add a site column and add this column to a custom content type. Here is my script : add-pssnapin Microsoft.SharePoint.PowerShell -EA 0 function ...
3
votes
1answer
1k views

How to remove the builtin “Item” Content Type from a list using powershell?

I have a custom content type and I added this content type to a list. I now want this list to only use the custom content type and I want to remove the built-in "Item" content type. I tried ...