Use OneDrive Client on RDSH or XenApp with FSLogix and PowerShell (IWC/ROW Building Block included)

You might notice there is no OneDrive client in Windows Server 2016. After installing Office ProPlus, you do get the OneDrive for Business client but that client isn’t as feature rich as the normal OneDrive client. But luckily we can download the normal OneDrive client from Microsoft website here. Now we run into the next problem; the OneDrive client will install itself into the user profile and not like any normal program into “C:\Program Files”. So, to use the OneDrive Client on Windows Server 2016 we need to solve a few problems first:

Install OneDrive for every user who signs into the system once.

Check if the installation is already present and start up the client.

Capture the installation of OneDrive and add the files in OneDrive to the profile.

Stop asking for password to the user every time they sign in.

Integration with Windows Explorer.

Choose what to sync to the system from OneDrive if needed.

To fix these issues we need two things. One; FSLogix Office 365 Containers, and two; a script that will check if OneDrive client is installed. If not, it will silently install the OneDrive client. As a bonus this blog includes an Ivanti Workspace Control (RES ONE Workspace) building block which will silently run the script at sign.

FSLogix Office 365 Container and OneDrive client

FSLogix Office 365 Containers creates a VHD file per user on a file share and stores the OneDrive client and the users OneDrive files into the VHD. If a user signs in the VHD gets attached (which is blazing fast) and the files and installation are immediately available for the user. And FSLogix does way more. It fixes the integration with Windows Explorer so recently used items and green checks are present. Also FSLogix makes sure that the user won’t get asked for credentials again if you use ADFS and AzureAD. When the user signs out the VHD is detached and everything is stored on a file share. Right now, there is no other way to do this except for creating a massive roaming profile or reinstalling and then redownload all files each sign in. So, with FSLogix our last problem is solved. The installation and OneDrive files are now in the Office 365 container!

Some customers want to choose what they sync from OneDrive to the system. Because Microsoft does not support this functionality on Windows Server 2016. FSLogix has a solution. Within the FSLogix policies you can set a SizeinMBs. Here you can set a hard limit to how big the container can get. Because FSLogix fools OneDrive that container size is the max limit, this way larger or more files won’t be synced to your client. It is the next best thing until Microsoft decides to provide proper GPOs to manage OneDrive.Click here on more information on FSLogix Office 365 Containers.

Check and install OneDrive silently into profile

Now, for the first two problems install the OneDrive client for each user in their profile and startup OneDrive. This isn’t that hard. I created a small PowerShell script which will check if you have OneDrive already installed. If so, it will launch the client in background mode. If you don’t have the client installed it will start a silent install and after that start the client.

The new updated exe can be placed in the location of the old one on the network.
For user who already have OneDrive installed in their profile you must enable auto updates. Or uninstall and reinstall the new one with a similar script.

This works fine, but the “Sync icon overlays” disappears after users log off and back on. It works OK initially after the installation during the first logon. Sync still works even if the status icons are missing.