How to install OneDrive on a Terminal server

How to install OneDrive on a Terminal server

So I had a client today that needed to have OneDrive for Business installed for their users on a Terminal Server.
After searching the web for a bit there was no clear instructions on how to do this.
The thing is if you install Office365 for example, it also installs OneDrive for Business.
BUT…it only installs it for the administrator.
And if you look in the start menu there are two different OneDrive.
One is simply named ”OneDrive” and the other one is named ”OneDrive for Business”.
And the one called ”OneDrive” will not start.

So this is how you solve the problem …


1. Log on to the Terminal server as a domain administrator.
2. Download the latest version of OneDrive (the file should be named OneDriveSetup.exe) at https://products.office.com/en-us/onedrive/download
3. Run a CMD prompt as administrator.

Onedrive01

4. Change the server to install mode by typing ”change user /install” in the CMD prompt and then press enter. 
(more about the different modes further down on this page)

Onedrive02

5. In CMD, go to the folder where you’ve downloaded ”OneDriveSetup.exe”.

Onedrive03

6. Type ”OneDriveSetup.exe /allusers” and press enter.

7. Wait until OneDrive have finished the install.

8. Type ”change user /execute” and press enter to change the server to Application mode.

Onedrive04

9. Now use the OneDrive app and not the OneDrive for Business app in the start menu and log in with your business Office365 account.

10. Done

The reason for why the ordinary OneDrive for business does not work in Terminal Server is because the binary (.exe file) is installed for the administrator only.
It’ located in the administrators appdata local folder.

When you install OneDrive with the /allusers switch, the binary installs in the Program Files folder so that all users can access it.
But all users on the Terminal Server users start their own instance of the binary and have their own synced files.

You can find more information about the different modes on a Terminal Server here:
https://support.microsoft.com/en-ca/help/252330/when-you-toggle-terminal-services-to-application-server-mode-some-prog

And more about OneDrive here:
https://docs.microsoft.com/en-us/onedrive/per-machine-installation