How to Enable Special Characters Support (# and % in file names) in SharePoint Online and OneDrive

FileSyncError-Featured

Recently I found a few organizations who have been using SharePoint Online and OneDrive for Business for more than a year now and still struggling with synchronizing files having % and # characters in the name. The problem is more evident with auto generated file names like reports generated by external systems which they wanted to store in OneDrive.

Problem

Just to highlight the problem again, by default for all Office 365 Tenants provisioned before June 2017, # and % characters can’t be used in the file names. If used, those files won’t be synchronized with SharePoint Online or OneDrive for Business using OneDrive Client.

File Sync Error

You will see OneDrive Client also shows an icon highlighting some issue with synchronization and when clicked it will show the message “Can’t upload files”.

OneDrive Sync Error

If you click on the highlighted message, you will see the detail about which files it could not sync. In this case as expected, it’s the file having the # character.

OneDrive Sync Error PopUp

Enable % and # Characters Support

Contrary to the statement “All existing Office 365 Tenants that have not opted into # and % support by H2 2017 will have # and % support enabled by default.” mentioned in this article, I found that this support did not get enabled by default in the Office 365 tenants which were provisioned in 2016.

OneDrive Client

To start with first ensure that you are using the latest version of OneDrive Client aka OneDrive.exe and NOT Groove.exe. You can find that by looking into the OneDrive client properties

OneDrive Client

Old OneDrive client is named “OneDrive for Business” and if you look at the file properties, you will find it’s Groove.exe. If you find that’s the case in your environment from here

Old OneDrive Client

Once you have the latest OneDrive client, all you need to do is to set the Office 365 tenant property “SpecialCharactersStateInFileFolderNames” to Allowed

First Attempt

I already had the latest version of SharePoint Online Management Shell installed. So, I just went ahead and opened the Shell and typed the below commands. This script works even if your admin account has Multi-Factor Authentication (MFA) enabled.

You will need to be at least SharePoint Administrator to Run this command.

[code]
Connect-SPOService -Url https://tenantname-admin.sharepoint.com
#Provide SharePoint Admin Credentials
Set-SPOTenant -SpecialCharactersStateInFileFolderNames Allowed
Get-SPOTenant | Format-List SpecialCharactersStateInFileFolderNames
[/code]

And was greeted with the error message right away

Script Error

Apparently, I didn’t have “latest” latest version of SharePoint Online Management Shell 🙁

Another Try

So, I went to https://www.microsoft.com/en-gb/download/details.aspx?id=35588 and downloaded the latest version of SharePoint Online Management Shell. But when tried to install that it complained that I would have to Uninstall the older version first. Well, I manually uninstalled and installed this latest version. I now have the version number as 16.0.7115.1200

SPO Management Shell

Went ahead and re-ran the PowerShell script and voila

PS Success

Even though the command output now says the property has been set to “Allowed”, it might still take between a few hours to a day before your synchronization starts working for files having special characters.

Once the sync starts working, you can see the file status as synced in the file explorer, with a green icon.

Sync With Special Chars

Note that special character file names are still not available for On-Premise SharePoint environments.

Enjoy,
Anupam

You may also like

1 comment

  1. Pingback: writeaessay

Leave a Reply

Your email address will not be published. Required fields are marked *