0

I'm upgrading our sharepoint from 2007 to 2013 and I'm running into an issue where the Field type is not installed properly. Removing that column from one list is easy and can be done through the website, but I would like to remove this field from all the lists in all the sites. Is there an easy powershell script to do this?

Error

Invalid

Any help would be greatly appreciated.

1

2 Answers 2

1

Instead of scripting this out I added the outdated .wsp solutions correctly before upgrading the database. This correctly installed the corrupted field.

You can get add these solutions using powershell or the admin console. I used powershell with the following commands

Add-SPSolution -LiteralPath <path>.wsp
Install-SPSolution -Identity contoso_solution.wsp -GACDeployment -CompatibilityLevel {14,15} 
0

The below script will help to delete fields form sharepoint list. if you want to automate then create CSV file which has List Name's and Fields.

Pass that CSV as input to the below script.

#Load SharePoint User Profile assemblies
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint") | out-null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server") | out-null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.Office.Server.UserProfiles") | out-null
[System.Reflection.Assembly]::LoadWithPartialName("Microsoft.SharePoint.PowerShell") | out-null
Add-PSSnapin Microsoft.Sharepoint.Powershell -ErrorAction:SilentlyContinue

#Global variables
$webUrl = "http://wwblrsp2013:1515/sites/OldRC/"
#List Name
$ListName = "PollQuestions"
# Deleted Field Name
$fieldName = "Test"

$spWeb = Get-SPWeb -Identity $webUrl 
$list = $spWeb.Lists[$ListName]
$listFields = $list.Fields
$listFields.Delete($fieldName);
$list.Update();

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.