Block download of SharePoint and OneDrive files by implementing Block Download Policy
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.
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
- 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.
- You will then need to enter your credentials
Step 4: Execute a PowerShell command to enable the Block Download Policy
- 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)
Experience for the Users
Once the PowerShell command above is executed, the users will see the following changes on a SharePoint site:
- 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. - The Sync option will be gone from the document library
- The Download option will disappear from the file features menu.
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.