OneDrive for Business: Block Syncing of Specific File Types

Requirement: Block syncing of specific file types in OneDrive for Business.

How to Block File Types in OneDrive for Business?

By default, Users can upload all types of files in their OneDrive for Business folder. However, for security, we can restrict users from syncing specific file types in OneDrive for Business.

  • Login to SharePoint Admin center at
  • Click on the “Settings” link under the left navigation
  • In the settings page, click on “Sync” next to “OneDrive” App. >> Enable “Block syncing of specific file types” checkbox and enter each file type per line.
    onedrive for business block file types
  • Click on “Save” to commit your changes.

These changes may take up to 24 hours to reflect. In the next sync cycle, If OneDrive for Business client detects any file matching blocked file extension,  any attempt to sync a blocked file type will give an error message “Item name is not allowed in the cloud”!

item name is not allowed in cloud

Also, on the OneDrive client, users get “OneDrive needs your attention. <File-Name> The name of a type isn’t allowed. Please rename the item or remove it from your OneDrive.” error.

onedrive for business block syncing of specific file types
Please note, this configuration will not *prevent* you from uploading a blocked file to either OneDrive for Business site or to OneDrive client sync location in your local machine. However, this prevents the sync from both ends!

PowerShell to Block File Types in OneDrive for Business:

We can also block file types using PowerShell as:

$TenantAdminURL = ""

#Connect to Admin Center
Connect-SPOService -Url $TenantAdminURL -Credential (Get-credential)

#Set blocked File types
Set-SPOTenantSyncClientRestriction -ExcludedFileExtensions "exe;mp3;mp4"

This PowerShell script blocks file types exe, mp3 and mp4 to not being synced with OneDrive for Business. Microsoft reference on block syncing of specific file types:

Salaudeen Rajack

Salaudeen Rajack is a SharePoint Architect with Two decades of SharePoint Experience. He loves sharing his knowledge and experiences with the SharePoint community, through his real-world articles!

Leave a Reply