none
Removing a record libray

    Question

  • Hi all,

    I'm having a strange issue.  I am completely unable to remove a records library from a site despite trying the following the answers here:

    https://social.technet.microsoft.com/Forums/office/en-US/95a9e1c3-27f2-47ce-b5b3-ea6633c4924a/cant-delete-document-library-that-used-to-have-automatic-record-declaration?forum=sharepointgeneralprevious

    There are 0 items in the records library now and running the hold processing and reporting job does nothing.  I have tried removing the library using SharePoint designer, however this results in an error claiming that there is something in that library the site needs to function, again this is unlikely because there is nothing in that library!!!

    Short of trying to remove it from the database I am at a loss of how to proceed.  Hopefully someone has encountered this before?

    Thanks in advance.

    Thursday, March 9, 2017 9:42 AM

Answers

All replies

  • Hi,

    Please try to delete this record library using PowerShell:

    $web = Get-SPWeb <site URL>
    
    $list = $web.Lists["List_datasheet"]
    
    $list.AllowDeletion = $True
    
    $list.Delete()
    

    If the library hasn’t been removed by PowerShell, please try to remove it by UI and provide a screenshot about the error message.

    Also, you can check for ULS logs of this issue, which would give you useful information to figure out the root cause.

    ULS viewer is a good tool to check for ULS logs and you can filter multiple error messages by keywords.

    Best Regards,

    Dean Wang


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Friday, March 10, 2017 2:29 AM
    Moderator
  • Hi,
    Is there any update?
    If my reply is helpful to you, you can mark as answer.
    Thanks,
    Dean Wang

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com

    Monday, March 13, 2017 1:14 PM
    Moderator
  • Hi,

    Thanks for this, it took a while to get in a position to be able to test it.  I'm afraid it doesn't seem to work, I get the following (Which mirrors the GUI unfortunately):

    Exception calling "Delete" with "0" argument(s): "This list cannot be deleted."
    At line:1 char:1
    + $list.Delete()
    + ~~~~~~~~~~~~~~
        + CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
        + FullyQualifiedErrorId : SPException

    Even setting the allow deletion variable.  Very frustrating!  It seems broken to be honest.

    Again, thanks for your help :) 

    Tuesday, March 14, 2017 2:05 PM
  • Hi,

    Looks like a was right the method here works: http://sharepoint.stackexchange.com/questions/73448/broken-lists-cannot-be-deleted

    TLDR:

    $web = Get-SPWeb http://web-url
    $list = $web.Lists["Documents"]
    $list.AllowDeletion = $True
    $list.Update()
    $web = Get-SPWeb http://web-url
    $custom = $web.Lists["Documents"]
    $custom.delete()

    This seemed to work for me


    • Edited by daemonbreath Tuesday, March 14, 2017 3:47 PM
    • Marked as answer by daemonbreath Tuesday, March 14, 2017 3:47 PM
    Tuesday, March 14, 2017 3:46 PM