SPO: Remove a Document Library that used to contain records

When you use “declare record” in a SharePoint Online library it makes the library un-deletable.

Even if you undeclare all records and remove all the files the “remove library” setting will be unavailable from the document library settings page in the UI.

Luckily this is easily remidied with some PnP PowerShell

Connect-PnPOnline https://.sharepoint.com -Credentials 
$list = Get-PnPList -Identity ""
$list.AllowDeletion = $true
$list.Update()
Remove-PnPList $list -Force
Advertisement

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s