Managing The Sharing Links Of Files Within A SharePoint Online Document Library

This article explains how to find all the document which have sharing links created, and recommended ways to delete the sharing links

As discussed in the previous article, using the Share option within a SharePoint Online library could create unique permissions within the document library. Over time these unique permissions could significantly grow which could cause issues in your SharePoint Online site.
 
This article describes the following topics on how to manage the Sharing Links.
 

Finding files which have Sharing Links created

  1. One can easily find all the sharing links created for a particular document/file through the library settings page. Below are the steps to get this information

  2. Open the SharePoint library using an admin or owner account, and browse to the list library page

    Managing The Sharing Links Of Files Within A SharePoint Online Document Library

  3. In the Library settings page, under Permissions and Management, click on ‘Permissions for this document library’.If there are files in your library which have sharing links created, you will see the below message on your library permissions page. If you do not see this message, then there are no files in the library which have sharing links created

    Managing The Sharing Links Of Files Within A SharePoint Online Document Library

  4. Click on ‘Show these items’ link in the message. This will open a pop-up or overlay which has the list of documents which have unique permissions. Click on ‘manage permissions’ against the document, for which you want to find the sharing links created.

    Managing The Sharing Links Of Files Within A SharePoint Online Document Library

  5. This opens the permissions management page for the chosen document. On this page, a message is shown at the bottom, which says that this document has one or more sharing links created. Click on the manage links to see the details.

    Managing The Sharing Links Of Files Within A SharePoint Online Document Library
  6. This shows the Manage Access overlay of that document using which you can see the list of sharing links which are created for this document and you can remove the links which are not required.

    Managing The Sharing Links Of Files Within A SharePoint Online Document Library
The same ‘Manage Access’ overlay can be opened directly from the context menu of a document. But, that way we have to open the ‘Manage Access’ details of all the documents in the library to find if it has sharing links or not. The advantage of going to the Permissions for this document is to narrow down the list of documents which have sharing links created. So, on this library permissions page, when we see documents which have security exceptions, there are high chances for that document to have sharing links. If you do not see any items with unique permissions in a library, it is safe to assume that they don’t have any Sharing Links created.
 

Delete the Sharing Link for a document/file

 
Using the above steps, we can find the Sharing Links of a document and can delete the sharing links using the ‘Manage Access’ overlay of a document.
 
Is there a better way of deleting the links? Yes. It is better to delete unique permissions on the document. At step 5 above, where we see the permissions management page of a particular document, we can click on the ‘Delete unique permissions’ button in the ribbon. This way, we not only delete all the sharing links on a document, but we also reset the permissions inheritance. When we delete the links from ‘Manage Access’ overlay, the unique permissions on the document are not reset.
 

Generating Reports

 
The options explained can be used for finding Sharing Links for a few documents. It’s really difficult to browse through for all the documents within a huge library to find all the Sharing Links. In my next post, I will explain how to generate reports and bulk delete Sharing Links using SharePoint Online CSOM code.