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: [email protected] (eg. [email protected]).
The domain part is usually your domain name with hyphens and fullstops removed, eg my-website.com becomes mywebsitecom and in place would be [email protected]
- Now lets store your credentials, mentioned above, as a variable by using the below code (with your details):
$creds = Get-Credential -UserName "[email protected]" -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):
Connect-SPOService -Url https://domain-admin.sharepoint.com -Credential $creds
- Next, we allow the special characters with the below command:
Set-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:
- 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’.