OneDrive Known Folder Move – Hurdles Galore

One thing is readily apparent when it comes to implementing “known folder move”, a new(ish) feature of Microsoft OneDrive.

Known folder move is sort of a start in terms of replacing roaming profiles on Office365. Turning it on redirects your Desktop, Documents, and other “library” folders into OneDrive, so your important files are backed up in OneDrive regardless if you store them in other popular places in Windows. You can read more about Known Folder Move here: https://docs.microsoft.com/en-us/onedrive/redirect-known-folders.

Since it uses OneDrive which is based on Sharepoint, it has all the various limitations of both platforms, especially when it comes to naming and file types. For example, you cant create a folder called “Forms” on OneDrive, and certain file types and characters aren’t allowed either. Another interesting tidbit I found, is that if you already had folders like “Documents” or “Desktop” in OneDrive, I believe it creates “Desktop2” or “Documents2”. Not good for consistency!

One “unsupported” file type is OneNote files. I’m not sure what black magic is going on behind the scenes when it comes to OneNote and OneDrive/Sharepoint, but as an IT admin, the best I can say is “it’s weird”. OneNote notebooks and sections appear as “files”, but it’s obvious there’s more to the eye there and they’re likely being stored as blobs or objects. This is why you can’t “move” a local OneNote notebook to OneDrive or Sharepoint; you have to create a new Notebook at your destination, and copy your sections from the old to the new one at a time.

This also means if you have or had OneNote files on your desktop or Documents folders, its basically going to stop you from enabling KFM. In fact I’ve found a LOT of things stop KFM from being enabled, such as:

      • OneNote files
      • Unsupported characters in file names
      • Group Policies that lock down ability to redirect personal libraries, as well as policies that actually redirect Desktop/Documents to other places
      • The weather
      • Looking at it wrong

I ran into an interesting issue with a couple users. Previously these users’ documents folders were redirected to a network share, ala “home drive”. Before I enabled KFM, I redirected their Documents folder back to the local profile. I then checked for any OneNote files, and transferred anything important to new notebooks on OneDrive. Lastly for consistency sake, I rename any existing “Desktop” or “Documents” folders on OneDrive so they’ll be available for the real Desktop and Documents folders.

Yet, KFM didn’t work, and listed a OneNote file as the reason. I clicked on the warning that supposedly takes me to the offending file, but it only took me to the recycle bin, but the file in question wasn’t there! I tried checking other places, even “emptying” the recycle bin, but KFM insisted it existed, and kept pointing at the recycle bin.

Finally I decided maybe the GUI wasn’t giving me the whole picture, and dropped to a Powershell prompt and cd’d into the $Recycle.Bin folder (it may be hidden, but you can still change into it). Sure enough not only where there all sorts of orphaned files in there, but lots of OneNote files.

(Note: To change into the $Recycle.Bin file in Powershell, the folder name has to be in single quotes. So cd ‘$Recycle.bin’. If you don’t use the quotes, Powershell won’t find the folder.)

I found a couple articles discussing this behavior:

Microsoft KB (old)
ForensicFocus.com

After manually cleaning out the recycle bin, KFM finally enabled. While I like the concept, KFM seems to be more temperamental than a 2 year old.

Have you run into any other gotchas with Known Folder Move? If so leave a comment below!

Making changes to DFS Namespaces in Windows Server

One thing I always seem to dread and battle is making changes to DFS Namespaces and shares. In addition, I also seem to struggle with the simple concept of reboot or even restarting a service, but that’s a topic for another day. (Or is it?)

In this case I was doing some minor file server cleanup at the end of a day, and moving data around. Part of this process was to delete a couple DFS namespaces and re-create them pointing to the new locations.

I ran into issues deleting the namespaces where the DFS console reports that the share must be manually removed. I believe this may have been caused by the shares/files being open by existing users (in this case its just templates and small files that aren’t mission critical.) Even though it reports this, I do see the DFS namespace gone from Active Directory (confirmed via ADSIEdit), the registry entries gone from the DFS key in the registry, yet on the server, when I try to delete the share from the folder I’m trying to move, it errors with “The share must be removed from Distributed File System before it can be deleted”.

Naturally I go down the path of doing some googling, and looking at blog posts talking about how to verify your DFS target was removed from active directory, from the file server registry, etc. This is all good practice anyway as it does verify things are cleaned up after a dirty removal of a namespace, but in my situation, the error still happened and I couldn’t un-share the old folder.

Simple answer: Reboot. In my case, after going down the AD and registry rabbit holes, I was able to restart the server service and let it restart any dependency services, and in doing so, it let me remove the share, re-share the new location, and create a new DFS namespace. I’d be willing to bet simply rebooting the server itself would have worked as well, but as we all know that’s not always an option when the workaholics are still plugging away at 7pm and I’m literally moving 15 files.

So definitely not a bad idea to check registry entries and AD objects when making DFS namespace changes, but start with a simple reboot, and get to go home 30 minutes sooner 🙂