In this SharePoint PowerShell tutorial, we will discuss how to delete a list in SharePoint using PowerShell. First, we will discuss PowerShell cmdlets to delete list using PowerShell in SharePoint 2013/2016.
We can easily delete a SharePoint list from the browser itself in SharePoint. Go to the List Settings page and then click on “Delete this list” which is under Permissions and Management. This deletes the SharePoint list from the site.
But if the list got corrupted then, we may not able to delete the list through a browser, We can use PowerShell to delete the SharePoint list.
Recently we got one issue where whenever we are trying to go to the settings page of the list we got Sorry, something went wrong issue. So we use PowerShell to delete the corrupted list.
SharePoint Tutorial Contents
Below is the PowerShell command to delete a particular list in SharePoint 2013/2016.
We can write the PowerShell script inside Windows PowerShell ISE or in visual studio code.
$web = Get-SPWeb("https://SiteURL/")
$list = $web.lists["List Name"]
$list.AllowDeletion = $true
$list.Update()
$list.Delete()
Once you run the above PowerShell script, the SharePoint list will get deleted from the site.
You can also use the below code to delete SharePoint list using PowerShell.
$siteURL="http://Site URL"
$listName="ListName"
$web=Get-SPWeb $siteURL $list=$web.Lists[$listName]
if($list -ne $null)
{
$list.Delete();
}
We can also use PowerShell to modify a list title and description in SharePoint 2010, SharePoint 2013/2016.
$site = new-object Microsoft.SharePoint.SPSite("http://site URL")
$web = $site.rootweb
$list = $web.GetList("/Lists/ListName")
$spList.Title = "Modified Title"
$spList.Description = "Modified Description"
$spList.Update()
This is how we can modify a SharePoint list using PowerShell.
If you are using SharePoint 2010, then you can follow the below steps to delete a list in SharePoint 2010.
Follow below steps to delete a SharePoint list:
Open the SharePoint site and navigate to the list which you want to delete. [You can also click on the List in the quick launch bar].
Then in the list page, From the Ribbon from List Tools section select List and Chose List Settings from the right-hand side as shown in the figure below:
Then from the list settings page, Under Permissions and Management select Delete this list link as shown in the figure below:
Once you click on Delete this list link, then it will ask you a confirmation message like below and then click on OK in the confirmation box. Then the list will get deleted.
This is how to delete a list in SharePoint 2010.
You may like following SharePoint tutorials:
- Delete content type from SharePoint list using PowerShell
- Microsoft Flow Example Save tweets that include specific hashtag to a SharePoint list
- Difference between SharePoint list and Document library
- Generate URL using Calculated column in SharePoint List
- Export Excel Data to SharePoint list from Excel itself
- How to disable quick edit in SharePoint list
- Export SharePoint list data to excel programmatically using JavaScript and SPServices
- Content Approval in SharePoint list or document library
This SharePoint tutorial, we learned how to delete a SharePoint list using PowerShell or through browser.
I am Bijay from Odisha, India. Currently working in my own venture TSInfo Technologies in Bangalore, India. I am Microsoft Office Servers and Services (SharePoint) MVP (5 times). I works in SharePoint 2016/2013/2010, SharePoint Online Office 365 etc. Check out My MVP Profile.. I also run popular SharePoint web site SPGuides.com