🎉 Our Microsoft 365 Reporting & Management Tool is now available in Azure Marketplace 🚀
This website uses cookies to improve your experience. We'll assume you're ok with this. Know more.
SharePoint Online

How to Get All Expired Sharing Links in SharePoint Online

Expired sharing links in SharePoint Online can weaken security and clutter permissions if left unchecked. Misconfigurations may keep sensitive files exposed, while legitimate users face sudden access issues. This guide explains how to find all expired sharing links so admins can close security gaps and ensure external access ends as intended.

Eliminate Security and Access Issues from Expired Sharing Links with Advanced Insights

AdminDroid’s SharePoint Online reporting tool provides Microsoft 365 admins with detailed insights into the expiry status of sharing links, such as links that are expiring soon, set to never expire, and more. These insights enable you to avoid potential security risks caused by expired sharing links across Microsoft 365.

Find Expired Anonymous Sharing Links to Remove Outdated Access

Monitor the expired anonymous sharing links report to confirm that “Anyone” links have properly expired and no longer grant content access for maintaining compliance with privacy policies.

Analyze Sharing Links That Never Expire to Detect Long-Term Access Risks

Identify never-expiring sharing links in SharePoint Online to minimize prolonged data exposure and prevent violation of retention policies.

Monitor Secure Link Events to Ensure Expired Secure Links are Properly Removed

Audit secure link events to verify whether expired secure links were removed or if access was extended with proper authorization in SharePoint Online.

Visualize Expired Link Insights with the Sharing Link Overview Dashboard

Track sharing links overview dashboard to check on link sharing summary along with details on expired links, upcoming expirations, etc., to prevent collaboration issues.

Identify Expired Sharing Links in OneDrive to Streamline Access Management

Monitor expired OneDrive sharing links to maintain controlled content sharing and support compliance requirements in Microsoft 365.

Audit Files and Folder Sharing Links to Ensure Compliance and Data Security

Review all file and folder sharing links to identify those shared with internal users, external users, or groups, and apply expiration on sensitive content to ensure timely access termination.

In summary, AdminDroid’s SharePoint Online management tool provides a detailed view of sharing links and their expiration details across all SharePoint Online sites. It also allows you to manage sharing links, view permission summaries by link type, track access request activities, and more to strengthen Microsoft 365 security.

Explore a full range of reporting options

Important tips

Restrict external site sharing settings by granting only site owners to create, view, or manage sharing links with expiration dates and passwords to ensure strict external access control.

Configure default sharing links in the SharePoint admin center to prevent users from creating ‘Anyone links’ and minimize the risk of oversharing.

Limit external sharing by domain and set link expiration to ensure accountability and maintain well-managed sharing activities.

Common Errors and Resolution Steps

Below are common errors and troubleshooting fixes that may occur while exporting all expired sharing links in SharePoint Online.

Error ./GetAllSharingLinks.ps1: C:\Windows\System32\GetAllSharingLinks.ps1 cannot be loaded. The file C:\Windows\System32\GetAllSharingLinks.ps1 is not digitally signed. You cannot run this script on the current system.

This error occurs because the current execution policy is set to “Restricted”, which blocks the script execution.

Fix To resolve this error, you can set the execution policy as shown below.
Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope Process Error

Error Remove-PnPFileSharingLink: The file /sites/ProjectWorkSpace/https://contoso.sharepoint.com/sites/ProjectSite/Shared Documents/General does not exist.

The error occurs when executing the Remove-PnPFileSharingLink cmdlet with an incorrect value in the -FileUrl parameter.

Fix Ensure that you're using the correct file URL. You can retrieve and verify the URL by executing the following cmdlet after being connected to the PnPOnline PowerShell module.
Get-PnPListItem -List "Shared Documents" | ForEach-Object { $_.FieldValues["FileRef"] }

Error Attempted to perform an unauthorized operation.

This error occurs when the GetAllSharingLink.ps1 script is executed without a certificate thumbprint.

Fix Create a self-signed certificate and replace <thumbprint> with the newly created certificate thumbprint to let the script access all sites, regardless of ownership.
Use the parameter -ExpiredLinks and run the command given below to list all the expired sharing links.
./GetAllSharingLinks.ps1 -CertificateThumbprint "<thumbprint>" -ExpiredLinks

Error Anonymous links are not enabled on your tenant.

This warning appears when you try to set an expiry date for Anyone links using the Set-PnPTenant cmdlet while these links are disabled tenant-wide.

Fix In the SharePoint admin center, go to Policies » Sharing» External Sharing.
Set the slider for SharePoint to ‘Most permissive’ under 'Content can be shared with' to enable Anyone links.

Error Set-PnPTenant: RequireAnonymousLinksExpireInDays must have a value between 1 and 730

This error occurs when you try to set the expiration using Set-PnPTenant with the -RequireAnonymousLinksExpireInDays parameter and the value exceeds the allowed limit.

Fix Set the tenant-level expiration period for ‘Anyone’ links to a value between 1 and 730 days.

Error Sorry, the link has expired.

This error occurs when the user is trying to access an expired sharing link in SPO.

Fix You may consider reaching out to the user who created the sharing link and request them to delete the expired links.Then, ask them to send a new sharing link with an expiration date.
Frequently Asked Questions

Manage Expired Sharing Links in SharePoint Online for Improved Access

Kickstart Your Journey With
AdminDroid

Your Microsoft 365 Companion with Enormous Reporting Capabilities

Download Now
User Help Manuals Compliance Docs
x
Delivering Reports on Time
Want a desired Microsoft 365 reports every Monday morning? Ensure automated report distribution and timely delivery with AdminDroid's Scheduling to your email anytime you need.
Delivering Reports on Time
Schedule tailored reports to execute automatically at the time you set and deliver straight to the emails you choose. In addition, you can customize report columns and add inteligent filtering to the activities just from the previous day to suit your Microsoft 365 report requirements.
Set It, Schedule It, See Results- Your Reports, Your Way, On Your Time!
Time Saving
Automation
Customization
Intelligent Filtering
Give Just the Right Access to the Right People
Grant fine-tuned access to any Microsoft 365 user with AdminDroid’s Granular Delegation and meet your organization’s security and compliance requirements.
Give Just the Right Access to the Right People
Create custom roles loaded with just the right permissions and give access to admins or normal users within AdminDroid. The result? A streamlined Microsoft 365 management experience that aligns your organization's security protocols and saves your invaluable time and effort.
Align, Define, Simplify: AdminDroid's Granular Delegation
Smart Organizational Control
Effortless M365 Management
Simplified Access
Advanced Alerts at a Glance
Receive quick notifications for malicious Microsoft 365 activities. Engage with the AdminDroid’s real-time alert policies crafted to streamline your security investigations.
Advanced Alerts at a Glance
Stay informed of critical activities like suspicious emails and high-risk logins, bulk file sharing, etc. Through creating and validating ideal alert policies, AdminDroid provides a comprehensive approach to real-time monitoring and management of potential threats within your organization.
AdminDroid Keeps You Always Vigilant, Never Vulnerable!
Proactive Protection
Real-time Monitoring
Security Intelligence
Threat Detection
Merge the Required Data to One Place
Combine multiple required columns into one comprehensive report and prioritize the information that matters most to you with AdminDroid’s Advanced Column Customization.
Merge the Required Data to One Place
This column merging capability offers a flexible way to add different columns from various reports and collate all the essential data in one place. Want to revisit the customized report? Save it as a 'View’, and your unique report is ready whenever you need it.
Merge with Ease and Save as Views!
Custom Reporting
Unique View
Desired Columns
Easy Data Interpretation
Insightful Charts and Exclusive Dashboards
Get a quick and easy overview of your tenant's activity, identify potential problems, and take action to protect your data with AdminDroid’s Charts and Dashboards.
Insightful Charts and Exclusive Dashboards
With AdminDroid charts and dashboards, visualize your Microsoft 365 tenant in ways you've never thought possible. It's not just about viewing; it's about understanding, controlling, and transforming your Microsoft 365 environment.
Explore Your Microsoft 365 Tenant in a Whole New Way!
Executive overviews
Interactive insights
Decision-making
Data Visualization
Efficient Report Exporting for Microsoft 365
Downloading your reports in the right file format shouldn’t be a hassle with AdminDroid’s Report Export. Experience seamless report exporting in various formats that cater to your needs.
Efficient Report Exporting for Microsoft 365
Navigate through diverse options and export Microsoft 365 reports flawlessly in your desired file format. Tailor your reports precisely as you need them and save them directly to your computer.
Take Control, Customize and Deliver- Your Office 365 Data, Exported in Your Way!
Easy Export
Seamless Downloading
Data Control
Manage Microsoft 365

Get AdminDroid Office 365 Reporter Now!