How to Lock Down File Sharing Links in Microsoft 365
What you'll need: A Microsoft 365 business account with admin rights (the "Global Administrator" or "SharePoint Administrator" role), about 30 minutes, and a list of everyone outside your business who still needs access to your files.
Why sharing links matter
When someone in your business shares a file from OneDrive (each person's own file storage in Microsoft 365) or SharePoint (shared team storage, often used for company-wide folders), Microsoft 365 creates a sharing link. This is a web address that opens the file.
Some links only work for specific people who sign in. Others, called "Anyone" links, work for whoever has the address, with no sign-in. If an "Anyone" link gets forwarded, posted, or pasted in the wrong place, a stranger could open your file.
This guide covers four settings that reduce that risk:
- Turning off or limiting "Anyone" links
- Changing the default link type
- Making links expire
- Reviewing what has already been shared
Before you start
- The settings in this guide apply to your whole tenant (your business's Microsoft 365 account as a whole), so they affect everyone in your business.
- Tell your team before you change anything. If people share files with clients or vendors, a link that suddenly stops working can cause confusion.
- Microsoft changes its menus often. If a label on your screen doesn't exactly match this guide, look for the closest match.
Step 1: Open the sharing settings
- Sign in to Microsoft 365 with your admin account.
- Open the Microsoft 365 admin center. This is the control panel for your business's Microsoft 365 account.
- In the left menu, under Admin centers, select SharePoint. If you don't see it, select Show all first. This opens the SharePoint admin center.
- In the SharePoint admin center, expand Policies, then select Sharing.
This page has settings for both SharePoint and OneDrive.
Step 2: Decide whether to allow "Anyone" links
Under External sharing you'll see two sliders, one for SharePoint and one for OneDrive. Each slider sets how far outside your business people can share files. From most open to most restricted, the options are:
- Anyone: People can create links that work without signing in.
- New and existing guests: Outside people can open files, but they have to sign in or enter a code sent to their email.
- Existing guests: Only outside people who are already in your account's directory can open files.
- Only people in your organization: No sharing outside your business.
To lock things down:
- Pick the level that fits how your business works. If you share files with clients regularly, New and existing guests lets you keep sharing while making people prove who they are.
- Move the SharePoint slider to that level.
- Move the OneDrive slider to the same level or a stricter one. OneDrive can't be set more open than SharePoint.
- Select Save at the bottom of the page.
Good to know: Turning off "Anyone" links also stops existing "Anyone" links from working. Microsoft also says that if sharing is turned off and later turned back on, old shared links can start working again. To make sure a link stays dead, delete it as shown in Step 5.
Step 3: Change the default link type
The default link type is the kind of link Microsoft 365 suggests first when someone clicks Share. Most people accept the suggestion, so this setting matters a lot.
On the same Sharing page, scroll down to File and folder links.
For the default link type, choose one of these:
- Specific people: The link only works for the people the sender names. This is the most restrictive choice.
- Only people in your organization: The link works for anyone in your business who signs in.
If "Anyone" sharing is still turned on, you'll also see Anyone with the link. Pick it only if most of your files aren't sensitive.
For the default permission, choose View instead of Edit, unless your team usually needs to edit shared files together.
Select Save.
People can still pick a different link type when they share, within the limits you set in Step 2. This setting only changes what's suggested first.
Step 4: Make "Anyone" links expire
If you kept "Anyone" links turned on, you can make them stop working on their own after a set number of days.
- On the Sharing page, find the section for "Anyone" links. It's usually labeled Choose expiration and permissions options for Anyone links.
- Select the check box These links must expire within this many days.
- Enter a number of days that matches how long people usually need access. A shorter time means less risk if a link ends up in the wrong hands.
- In the same section, set the permissions for both files and folders to View if outsiders don't need to edit.
- Select Save.
If you shorten the expiration time later, existing links switch to the shorter limit. If you make it longer, existing links keep the expiration time they already had.
You can also make guest access expire automatically. (Guests are people outside your business who sign in.) Under More external sharing settings, turn on Guest access to a site or OneDrive will expire automatically after this many days and enter a number.
Step 5: Review what has already been shared
Changing the settings doesn't always clean up old links, so check what's already out there.
In OneDrive (ask each person on your team to do this in their own OneDrive):
- Open OneDrive in a web browser and sign in.
- Select Shared in the left menu. This shows files you've shared and files others have shared with you.
- Select a file that no longer needs to be shared. Then select Info (the "i" icon in the top right) and choose Manage access.
- Remove the link, or remove the people who no longer need access.
For team sites (in SharePoint):
- Open the SharePoint site.
- Select a file or folder, then choose Manage access to see who can open it.
- Remove any links or people who no longer need access.
For admins checking the whole business: The SharePoint admin center has a Sharing links report under Reports > Data access governance. This report needs a SharePoint Advanced Management license, which not every plan includes. If you don't have it, use the file-by-file checks above.
Step 6: Tighten individual sites if needed
Some SharePoint sites hold more sensitive files than others, like payroll or contracts. You can give just those sites stricter rules.
- In the SharePoint admin center, select Sites, then Active sites.
- Select the site you want to restrict.
- On the Settings tab, select More sharing settings.
- Choose a stricter sharing level. A site can be stricter than your business-wide setting, but never more open.
- Save your changes.
Quick checklist
- "Anyone" links are turned off, or limited to view-only with an expiration date
- The default link type is Specific people or Only people in your organization
- The default permission is View
- Old shared links have been reviewed and cleaned up
- Sensitive sites have stricter sharing rules
- Your team knows what changed and who to ask for help
Sources
- Microsoft Learn: Manage sharing settings for SharePoint and OneDrive in Microsoft 365
- Microsoft Learn: Sharing options are grayed out when sharing from SharePoint Online or OneDrive
- Microsoft Learn: Microsoft 365 guest sharing settings reference
- Microsoft Learn: Best practices for sharing files and folders with unauthenticated users
- Microsoft Learn: Change the sharing settings for a site
- Microsoft Learn: Collaborate with guests in a site (IT Admins)
- Microsoft Learn: Overview of external sharing in SharePoint and OneDrive in Microsoft 365
- Microsoft Support: See files you shared in OneDrive
- Microsoft Learn: Data access governance reports for SharePoint sites