Change SharePoint Online Sharing Links to Read-Only with PowerShell
Question details
The user wants to change existing SharePoint Online file-sharing links in a document library to read-only access, preferably in bulk with PowerShell.

- Product
- SharePoint Online
- Device & OS
- not provided
- Scenario
- A document library contains sharing links, including links used by external users, that need to provide view-only access.
- Observed behavior
- There is no supported PowerShell command that automatically converts all existing sharing links in the library to read-only access.
Confirm that you have permission to manage sharing for the affected files and identify which links allow editing, including links used by external recipients. Check your organization's external sharing policies before replacing any links.
Review and replace editing links with view-only links
Use SharePoint's Manage access controls to handle existing links for individual files.
In the SharePoint document library, select a file, open the ellipsis menu, and choose Manage access.
In Manage access, review the Links section and identify links that grant editing access. Also check direct access separately, since it is not the same as link access.
Open the settings or menu for an unwanted editing link and choose the option to remove it. Removing a link prevents recipients from using that link.
Select Share, open Link settings, choose an allowed audience and set the permission to Can view, then apply the settings and send or copy the new link.

Evaluate supported options for bulk link management
Use this approach when the library has too many files to review individually.
Work with shared Office files in WPS Office
WPS Office is a free, lightweight alternative with a familiar interface for working with Office documents. Its format support helps you move existing files into WPS with minimal disruption. SharePoint sharing-link permissions must still be managed in Microsoft 365.

Frequently Asked Questions
Can PowerShell automatically change every existing sharing link in a library to read-only?
There is no supported command that automatically converts all existing links across a library. Review current Microsoft Graph and SharePoint PowerShell documentation for supported operations, and test any automation on a limited set of files.
Does changing a SharePoint group's permissions also change sharing links?
Not necessarily. Group permissions and sharing-link permissions are separate access paths. Open a file's Manage access panel to review its links and direct access.
What happens when I remove an editing link?
Recipients can no longer use that link, but they may still have access through another link, direct access, or group membership. Create and distribute a new Can view link if appropriate.
Can external users receive a view-only link?
They can if your organization's and site's external sharing policies allow the selected link audience. In Share, open Link settings, choose an allowed audience, and select Can view.




