| Method | Bulk removal | Cross-site scope | Link-scope detail | Scripting required |
|---|---|---|---|---|
| Manage Access panel (per file) | No | No, one item at a time | Yes | No |
| PnP PowerShell | Yes, with a written script | Yes | Yes | Yes |
| Share Link Finder (ShareMaster) | Yes, every link in the libraries picked (paid licence) | No, one site at a time | Yes, link type and members | No |
Three ways to find out how many shared links exist across a SharePoint tenant and clean up the ones nobody needs anymore: the built-in Manage Access panel, a PnP PowerShell script, and ShareMaster's Share Link Finder. Each covers the same ground with a different amount of manual effort.
What is a SharePoint shared link, and why does it need auditing?
A shared link is a URL generated by the Share button on a file or folder that grants access without adding a named person to a site's permission groups. Links can be scoped to "anyone with the link," "people in your organisation," or specific named people, and each scope is progressively less risky. The problem is that links accumulate silently: a link created for a two-week project review often outlives the project by years, and nobody revisits it unless something prompts an audit.
Option 1: Manage Access panel
Every file and folder in SharePoint Online has a Manage Access panel reachable from the item's context menu, showing every shared link currently active on that item along with who created it and its scope. An owner can revoke any link directly from this panel with a couple of clicks.
This works well when you already know which file is a problem. It does not work as an audit method, because there is no tenant-wide or even site-wide view: checking a library of a thousand files means opening a thousand Manage Access panels one at a time. For a single suspicious file flagged by a user, this is the fastest option available. For anything broader, it does not scale.
Option 2: PnP PowerShell
Get-PnPFileSharingLink and the related Get-PnPSharingLinkAccessRequests cmdlets return sharing link data per file or per library, and can be looped across every site collection in a tenant with a script:
Get-PnPListItem -List "Documents" | ForEach-Object { Get-PnPFileSharingLink -Identity $_.FieldValues.FileRef }
Looping this across every library in every site collection is where the real engineering effort goes. The cmdlets return data one item at a time, so a tenant with tens of thousands of files means tens of thousands of individual calls, and throttling becomes a real concern on large tenants. Removal requires a second script using Remove-PnPFileSharingLink, run carefully against exactly the links identified as stale.
PowerShell is free and gives full control over exactly which links get removed and under what criteria. The tradeoff is the same one that applies to most PowerShell-based SharePoint auditing: someone has to write it, test it against a non-production site first, handle authentication and module versions, and maintain it as PnP PowerShell itself evolves.
See the full guide to auditing shared links across a tenant for the query patterns that scale to larger site counts.
Option 3: Share Link Finder (ShareMaster)
ShareMaster's Share Link Finder audits shared links and unique permissions in the document libraries you pick on a site, one site at a time, without a script. Its Excel report names every link group on the site with the people in it, and the group name tells you the scope and whether it grants view or edit; a sheet per library then shows which files and folders carry a link. Expiry dates, link creators and creation dates are not in the report; for the who and when, search the Microsoft Purview audit log. Reporting is free on the Community licence.
With a paid licence (Recycle Master or Clone Master), a single run strips every sharing link from the chosen libraries. There is no per-link choice inside a library, so it suits libraries where nothing shared should stay, with any exceptions dealt with one by one in the Manage Access panel. It also identifies items with broken permission inheritance and can restore inheritance on all of them in the libraries picked. If you need to remove only one link type, or only expired links, the ShareMaster V2 beta can narrow a removal that way.
The tool does not change a tenant's external sharing default or any other tenant-level setting. It works within whatever sharing policy is already configured, auditing and cleaning up the links that exist under that policy today.
Shared links vs unique permissions: key differences
| Shared link | Unique permission (broken inheritance) | |
|---|---|---|
| Created by | Share button on a file or folder | Adding a person or group directly to an item's permissions |
| Visible in default views | No, requires Manage Access panel | No, requires a permissions check per item |
| Typical risk | Anyone-with-the-link access outliving its purpose | An item silently accessible outside its library's normal permission set |
| Cleanup action | Revoke the link | Reset inheritance to match the parent library |
Decision Matrix
| Situation | Recommended method |
|---|---|
| One flagged file, know exactly where it is | Manage Access panel |
| Full control over query logic, in-house scripting resource | PnP PowerShell |
| Recurring scheduled script, comfortable maintaining it | PnP PowerShell |
| Site-by-site audit with no scripting resource | Share Link Finder |
| Need both shared-link and broken-inheritance cleanup in one tool | Share Link Finder |
| Remove only one link type, or only expired links, without a script | ShareMaster V2 beta |
Frequently Asked Questions
What is a SharePoint shared link, exactly?
A URL generated when a user shares a file or folder using the Share button, rather than granting access by adding a named person to the site's permission groups. Scope can be anyone with the link, people in the organisation, or specific people.
Does removing a shared link delete the file?
No. It only revokes the access that link grants. The file and any access granted through named permissions or group membership is untouched.
Can I audit shared links without changing my tenant's sharing policy?
Yes. Auditing and removing individual links is a per-item action and does not touch the tenant-wide external sharing default.
Once stale links are cleared, the guide to fixing broken permission inheritance covers the related cleanup of unique permissions left behind by ad hoc sharing.