Showing posts with label SharePoint. Show all posts
Showing posts with label SharePoint. Show all posts

Wednesday, April 16, 2014

Sharepoint 2010 - Delete this List link missing

I have been making custom list definitions and list instances in Visual Studio.  I was building and deploying the lists and noticed on the list details screen that the menu item "Delete this List" in  list settings is missing. 

Problem:

My mistake was to set Allow Deletion to false

  <ListTemplate
        Name="ListDefinition1"
        Type="10001"
        AllowDeletion="FALSE"
        DisallowContentTypes="FALSE"
        BaseType="0"
        OnQuickLaunch="FALSE"
        SecurityBits="11"
        Sequence="410"
        DisplayName="Equipment Booking"
        Description="My List Definition"
Image="/_layouts/images/itgen.gif"/>
Once this is done you no longer see the "Delete this List" link in the list settings and is intended to protect lists with items declared as records. 
Solution:
So how do you fix it.  Not through the UI but with powershell
1.) Start > Programs > Microsoft SharePoint 2010 Products
2.) Select SharePoint 2010 Management Shell which opens a power shell session
3.) Punch in following script:
$assignment = Start-SPAssignment
$web = Get-SPWeb -Identity "http://yoursite" -AssignmentCollection $assignment
$list = $web.lists["Your List Title"]
$list.AllowDeletion = $true
$list.Update() #after this is entered, the "Delete this List" link will reappear in the UI for the List Settings
$list.Delete() #this will delete the list
Stop-SPAssignment $assignment



source:http://webdevshareetc.blogspot.com/2012/01/sharepoint-2010-delete-this-list-link.html

Wednesday, August 7, 2013

A service application database was deleted in SQL Server Management Studio


Solution
Using PowerShell, run the following command:
Get-SPDatabase | where {$_.exists -eq $false}
This will list all databases in SharePoint that no longer exist on the database server. If you are happy with the result and wish to remove the orphaned databases, run the following command:
Get-SPDatabase | where {$_.exists -eq $false} | foreach {$_.delete()}

Source:
http://www.mysharepointadventures.com/2012/02/cleaning-up-deleted-databases-in-sharepoint/