“Content Types that are available to this Document Set have been added or removed. Click here to update the Document Set.”

Use the following script to update all document sets. This method updates the Document Set item with any changes made to allowed content types. For its content type, it also adds the newly added content types to the list so that they are allowed in the document set.

PowerShell Script:

Add-PsSnapin Microsoft.SharePoint.PowerShell
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.Office.DocumentManagement”)
[void][System.Reflection.Assembly]::LoadWithPartialName(“Microsoft.SharePoint”)
$weburl = “http://yourSharePointSite”
$web = Get-SPWeb $weburl
$lib = $web.Lists[“Document Library Name”]
foreach($item in $lib.Items | Where-Object {$_.Folder -ne $null})
{
Write-Host “Provisioning ” $item.Name
$ds = [Microsoft.Office.DocumentManagement.DocumentSets.DocumentSet]::GetDocumentSet($item.Folder)
$ds.Provision()
}

Advertisements
This entry was posted in PowerShell, SharePoint 2010. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s