Running Content Iterator in PowerShell

PowerShell can be very useful to quickly write up a script when you need to say update a field value for items in a list.

But what happens if your list happens to have 100,000+ items? Doing SPList.Items is going to get throttled.

And while PowerShell doesn’t have an equivalent for the ContentIterator class (which can iterate through large data sets while avoiding throwing a SPQueryThrottledException), we can run custom code through PowerShell that¬†utilizes ContentIterator.

The script below does a simple field update for items of a specific content type in a list.

Continue reading


Deleting Site Columns

When trying to delete a site column, you may get the error “Site columns which are included in content types cannot be deleted. Remove all references to this site column prior to deleting it.”

Delete Site Column Error

This simply means that the site column needs to be manually deleted from content types before it can be properly removed.

You may have already manually done so on all content types you know of that refers to the site column, but the error still persists.

This is because it not only needs to be deleted from content types on the site collection level, but on all site level content types as well!

Continue reading