If you’re seeing errors syncing files and/or folders containing special characters such as a # and %, then it’s likely because you haven’t allowed syncing of these. For some reason Microsoft disable this as standard, so you manually have to enable it.
Here’s what this issue looks like:
OneDrive ‘The name or type isn’t allowed’
The error doesn’t really tell you that you can enable them and I’m not sure why it’s on by default in the personal OneDrive, but not in the business edition.
How to enable syncing of files and folders containing special characters with OneDrive Business
To enable the use of #, % etc in your files and folders within OneDrive Business, simply follow the below steps:
- Install the ‘SharePoint Online Management Shell‘ tools.
- Open the ‘SharePoint Management Shell’.
- For the next step, you need to know your main Office 365 administrator account. This is usually in this format: firstname.lastname@example.org (eg. email@example.com).
The domain part is usually your domain name with hyphens and fullstops removed, eg my-website.com becomes mywebsitecom and in place would be firstname.lastname@example.org
- Now lets store your credentials, mentioned above, as a variable by using the below code (with your details):
PowerShell1$creds = Get-Credential -UserName "email@example.com" -Message "Login"
- Enter your password in the challenge response window:
- Next we will connect using the above variable, replace domain with your Office 365 domain (eg mywebsitecom-admin.sharepoint.com):
PowerShell1Connect-SPOService -Url https://domain-admin.sharepoint.com -Credential $creds
- Next, we allow the special characters with the below command:
PowerShell1Set-SPOTenant -SpecialCharactersStateInFileFolderNames Allowed
- It might take a few minutes before the command goes through and annoying, there’s no confirmation.
- You can check if the setting has been changed by running by using the below code:
Keep in mind that the change could take some time to replicate through Microsoft servers. In my case it took approximately an hour.
- I’m not 100% sure if you need to do this, but to be safe I closed the OneDrive Business application and re-opened it.
- Close the ‘SharePoint Management Shell’.