Skip to content

Instantly share code, notes, and snippets.

@antonio-leonardo
Created July 18, 2019 21:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save antonio-leonardo/7c7f0b040821329dadd4c6cf249f4048 to your computer and use it in GitHub Desktop.
Save antonio-leonardo/7c7f0b040821329dadd4c6cf249f4048 to your computer and use it in GitHub Desktop.
Delete a corrupted SharePoint list
##Script para Deletar Listas corrompidas
Add-PSSnapin Microsoft.SharePoint.PowerShell
#Get the Web
$web = Get-SPWeb "<SharePoint-site-URL>"
#Get the corrupted List
$list = $web.lists["corrupted list name"]
#Set the AllowDeletion Flag to True
$list.AllowDeletion = $true
$list.Update()
#Delete the list
$list.Delete()
#Or can try this
#Get-SPWeb "http://sharepoint-site-url" | where-object { $_.Lists["corrupted list name"].Delete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment