Skip to main content
< All Articles

Block download of SharePoint and OneDrive files by implementing Block Download Policy

Posted on June 3, 2024
SharePoint

I published an article some time ago on preventing file downloads in SharePoint. While simple to implement, it has a few fundamental limitations. Specifically, it requires you to deviate from the default permission levels. Also, it does not work when users still need to edit the documents. The technique I am about to describe in this article is by far my favorite option. With a simple PowerShell command, you can prevent the download option on any SharePoint site or OneDrive. The only downside of this option is that it requires the organization to enroll in an Advanced Management add-on, which costs extra money.

Step 1: Enroll in Advanced Management Add-On

As mentioned above, this option requires you to enroll in the Advanced Management Add-on before it can work.

Block Download Policy

Step 2: Install SharePoint PowerShell

If you do not have PowerShell installed yet, you can do so by following this link.

Step 3: Connect to your tenant

  1. Next, you must connect to your tenant by running this command: Connect-SPOService -Url https://domain-admin.sharepoint.com, where domain is your tenant domain. In my case, it is sharepointmaven.Block Download Policy
  2. You will then need to enter your credentialsPreventfiledownloadsharepointblockpolicy3

Step 4: Execute a PowerShell command to enable the Block Download Policy

  1. The last step is to run the command that will enable the Block Download Policy on a given SharePoint site. Here is the syntax: Set-SPOSite -Identity https://domain.sharepoint.com/sites/sitename -BlockDownloadPolicy $true, where https://domain.sharepoint.com/sites/sitename is the actual URL of your SharePoint Site (in my case, it is https://sharepointmaven.sharepoint.com/sites/QualityDocuments)Block Download Policy

Experience for the Users

Once the PowerShell command above is executed, the users will see the following changes on a SharePoint site:

  1. They will see a warning message displayed at the top of the site:
    Your organization’s security policy doesn’t allow you to download, print, or sync from this site. For help, contact your IT department.Block Download Policy
  2. The Sync option will be gone from the document libraryPreventfiledownloadsharepointblockpolicy6
  3. The Download option will disappear from the file features menu.Block Download Policy

Additional Information about Block Download Policy

I also suggest you check out this Microsoft article about the Block Download Policy, which explains the additional syntax for using the above-mentioned PowerShell command, as well as provides instructions on how to prevent downloads for OneDrive for Business.

About Me

I’m Greg Zelfond, a U.S. based SharePoint consultant, and I provide affordable out-of-the-box SharePoint consulting, training, and configuration assistance to small and medium-sized businesses all over the world.

Need help?