Use OneDrive Client on RDSH or XenApp with FSLogix and PowerShell (IWC/ROW Building Block included)
You can now install OneDrive in the program files folder with /allusers switch. Read about it here.Read about it here.
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.
You can paste this script into your User Environment Manager and let it run with or without (depending on UAC settings) elevated rights during sign in of a user. Here you can download an Ivanti Workspace Control (RES ONE Workspace) Building block which will run this script hidden with elevated rights during sign in of a user. Make sure to not capture any REG keys and files in the profile when you use Zero Profiling.
Now we have solved all problems and when the user signs in, he or she can enjoy working with the OneDrive (non buisness) client.
I hope this was informative. For questions or comments you can always give a reaction in the comment section or contact me:
Hi Chris,
This works great. One question:
How do you handle updates for the OneDrive for business client with this method in a non-persistent VDI environment?
Hi Maarten,
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.
Ger Chris.
Hello Chris,
Small question, how you specify to OneDrive to check Update from network location and not from internet ?
Thx in advance
Maybe check out the OneDrive GPO’s https://docs.microsoft.com/en-us/onedrive/use-group-policy
I don’t find policy about this, i have already installed last OneDriveADMX.
If you can help me on this issue it will be very appreciate .
Hello!
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.
Any tips to fix this?
Regards
Fredrik
No have the same problem with IWC enabled haven’t found a fix yet.
Hi and thanks for your reply!
Does this mean that you are facing the same problem as us? Not getting the OneDrive icon overlays when using FSLogix O365 containers? Do you think this is a “bug” in the FSLogix software?
Regards
Fredrik
I think it’s an issue with Ivanti workspace control changes the explorer.
OK, we are not using the IWC in our environment.
When testing the FSLogix Profile Container – instead of the O365 container – it works fine.
Oh ok, are you combining the profile technology with something else? And maybe report it to FSLogix?
No, not combining with anything else. Just standard 2012r2 RDS enviroment using roaming profiles. I have now created a support ticket @ FSLogix support.
Hi, Thanks for your post. I am trying to set this up on Windows 2019 server (for XA use case). We don’t have FSLogix but trying to use UPM to make it to work.
If I use your script and don’t include Localappdata\microsoft\Onedrive in my UPM, then for every logon, the one drive install happens and it takes more than a minute for onedrive icon to appear (But it works). It does try to do an autoinstall and you see two versions
If I include Localappdata\microsoft\Onedrive in my UPM, then it is part of the profile but the problem is, every subsequent logon creates multiple versions of Onedrive folder, bloating the profile.
Tried including disabling onedrive updater in Taskscheduler as part of the script and also tried renaming onedrivestandaloneupdater.exe file but the update keeps happening.
I am running your script as user logon script through gpo.
My aim is to have the onedrive install happens once during first logon (taking longer time) and subsequent logons use existing installation and simply start the process. But that is not happening. any help is appreciated.
Hi Matheen, you can now install OneDrive in the program files with the /allusers switch. Check out this article https://docs.microsoft.com/en-us/onedrive/per-machine-installation it will help your problem.
Hi Chris,
Thank you very much for the reply and the link. I have installed that on Server 2016 1607 with latest one drive templates. All working as expected. Very nice.
BTW, I stumbled across your blog recently and it lives by its name (Guru)
Hi Chris,
I am using Ivanti Workspace Control and FSLogix.
Ran installation using /silent /configure_business:
When I start OneDrive, it will always ask for credentials. Any idea?
When using OneDrive Sync it asks the user what folders to sync and shows a list of the folders and the size of each. The problem is that with FSLogix holding the profile it almost always says there isn’t enough space. The FSLogix containers are dynamic and set with the default size of 30GB, but OneDrive doesn’t see enough space of the disk to be able to sync even a couple of gigs of data. How can I get the container to expand or allow for more OneDrive folders?
Make sure to use files on demand !
Files on Demand is enabled via GPO.
Ok with policy or reg key you can set the 30 GB limit higher. But it should not effect the OneDrive sync. That looks at how much free space there is Iton the c drive not the link to the container.
Ok, let me provide some additional information which may change things. When I originally setup FSLogix GPO settings for the Profile Container I did not take the default settings for the size of the VHD. I clicked the enable button and left the size at 500mb. I have since gone back and changed the size to 30GB, but some users have the 500mb profile container and they cannot sync several of their OneDrive folders due to the size of their Profile Container. Is there a way to increase those with the smaller VHD or should I just blast the smaller VHD so they can get a fresh larger VHD with the default setting of 30GB?
Because it’s purely chache files I would destroy them and then create new once
We have FSLogix and ResOne with a similar setup on the win22 server, with office container enabled.
OneDriveSetup.exe /allusers
Machines are not Azure join and use onprem AD
Im failing to initiate SSO , any suggestions ?