How to Lock a File in SharePoint Document Library?

SharePoint document library allows us to set the password while sharing files. As a result, we can secure our files. In this SharePoint Online tutorial, I will show you step-by-step instructions for locking a file in a SharePoint document library using a password.

Locking a file or folder is possible when we share a document library, a file, or a folder with external users. Even though we can set a password on SharePoint Online document library files or folders for internal users, it won’t work for them.

Also, if anyone wants to unlock a file, only that user can open the file and view it by entering the password.

Lock a File in SharePoint Document Library

Lock a File in a SharePoint Online Document Library

To lock a file within a SharePoint document library and share it with users, follow the steps:

  • Enable Sharing Settings to Anyone for the User Site
  • Deactivate the Limited-access user permission lockdown mode
  • Share a file by locking in a SharePoint Online document library

Enable Sharing Settings for Anyone at the Site Level

In this section, I will show you how to enable sharing settings for Anyone at a site level through the SharePoint admin center.

By default, external sharing will be enabled for anyone at a SharePoint Tenant level.

  • Open a SharePoint admin center, expand Sites, and click on Active sites.
SharePoint online document library file locking
  • Search and select a site for which we need to enable sharing settings to anyone.
How to lock a file in SharePoint document library
  • In the Settings tab, select Anyone in External file sharing, then click Save.
How to lock files in modern SharePoint document library

This is how to enable external sharing to anyone at a site level in a SharePoint Online document library.

Check Create a SharePoint Document Library in Power Automate

Deactivate Limited-access User Permission in Lockdown Mode

Now, I will show you the next step, i.e., deactivating limited access user permissions lockdown mode in a SharePoint Online site.

When the Limited-access user permission lockdown mode is enabled, permissions for users in the “limited access” permissions level (such as Anonymous Users) are reduced, preventing access to Application Pages.

  • Open a SharePoint Online site, Select Site information under Settings, and click on View all site settings.
How to lock a SharePoint document library file
  • Select Site collection features under Site Collection Administration on the Settings page.
Locking a SharePoint document Library file
  • Go to Limited-access user permission lockdown mode, and click on the Deactivate button.
SharePoint Online document library File locking with an examples
  • It will redirect to the next page to confirm deactivation; click on Deactivate this feature.
SharePoint document library File locking with an examples

This is how to deactivate the limited-access user permission lockdown mode under site collection administration.

Share a File by Locking in a SharePoint Online Document Library

Now, I will explain how to share a file with file locking in a SharePoint Online document library.

  • Open a SharePoint Online document library, then select the file you want to lock.
Share a file by locking in SharePoint document library
  • Click on the Share option, which is present next to the selected item or in the command bar.
Locking a file in SharePoint Online document library
  • Then, a Share dialogue box will appear; click on Sharing settings.
SharePoint document library lock a file by password
  • In Sharing settings, set a strong password for the file you want to share with users, then click Apply.
Lock a File in SharePoint Document Library
  • Then it will open the Share dialogue box again, where I was entering the email IDs of external users.
Create a password for a file in SharePoint
  • Whenever a user tries to open a SharePoint document library file, it will ask to enter a password to unlock it, as shown in the figure below:
How to create a Password in SharePoint document library

This is how to share a file by locking it in a SharePoint Online document library.

Conclusion

In this tutorial, we learned how to lock a file in a SharePoint document library. To do so, we need to follow the steps below:

  • Enable Sharing Settings to Anyone for the User Site
  • Deactivate Limited-access user permission lockdown mode
  • Share a file by locking in a SharePoint Online document library

You may also like the following tutorials:

>

Build a High-Performance Project Management Site in SharePoint Online

User registration Power Apps canvas app

DOWNLOAD USER REGISTRATION POWER APPS CANVAS APP

Download a fully functional Power Apps Canvas App (with Power Automate): User Registration App

Power Platform Tutorial FREE PDF Download

FREE Power Platform Tutorial PDF

Download 135 Pages FREE PDF on Microsoft Power Platform Tutorial. Learn Now…