RemoteApp and the missing OneDrive client

As more and more organizations are shifting to OneDrive and remote work, things like Remote Desktop Services and RemoteApps offer a great way of publishing applications without the need for VPN. It also offers a way of accessing applications without having them installed on your current device.

There is however a common challenge with remote apps. How do we transfer files from the local device to the server without the user having to go through VPN or opening other non secure ways. The common answer to this is “just let them save to onedrive”. Said and done OneDrive is installed for all users on the session host. You logon and onedrive never launches.

The reason behind this behavior is that OneDrive automatically starts from the Run keys in registry. The Run keys are only processed when the Explorer shell is started. With RemoteApp, Explorer is not the shell but rather the Remote Desktop service provides a shell for the application.

The solution

There is a simple yet very effective solution. The team behind Remote Desktop Services and Windows have implemented the following registrykey

HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RailRunonce

This works the same way as the normal run key so if you create a String record named OneDrive with the Value of “C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe” /background

OneDrive RailRunOnce

Notes

There is one important thing to note here. If you are running a multi session host setup User Profile Disks does not support OneDrive redirection. For this to work please switch to FSLogix which in most cases are included in the preexisting Remote Desktop services licensing. You can read more about FSLogix here https://docs.microsoft.com/en-us/fslogix/overview


By Peter Löfgren

I am a positive, hands-on, consultant with a passion for innovation who thrives on opportunities to be on the cutting edge of technology. Splitting my time between trainings, workshops, and consulting has allowed me to gain unique insight and perspective for my clients. My 10+ years of expert Windows knowledge and experience allows me to guide my customers to achieve new client platforms. By using all new Microsoft technology, I help my customers build and maintain production solutions for years to come.

Some of my notable accomplishments are:
Being chosen to present at Tech Days
Being a trusted advisor for US companies
Deployed a new platform for a large bank in Sweden