we are running Windows 10 Enterprise as stateless VDIs. Everytime someone logs in, the OneDriveSetup is running and uses a lot of cpu usage for around 30-50s.
We disabled the OneDrive Usage with a group policy, but the setup is still running everytime.
Windows Updates are disabled!
There are quite a few places that OneDrive has buried itself in in Win10. Perform the following steps from a command line on your master(assuming 64-bit OS):
taskkill /f /im OneDrive.exe
Check under the following registry paths for OneDrive active setup keys. If there is one with ComponentID referencing OneDrive with a "StubPath" key - delete the stubpath key.
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Active Setup\Installed Components
HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\Active Setup\Installed Components
Load the default NTUSER.dat file and delete OneDrive activesetup stubpath keys in there as well:
HKU\<DEFAULT.dat>\SOFTWARE\Microsoft\Active Setup\Installed Components
HKU\<DEFAULT.dat>\SOFTWARE\WOW6432Node\Microsoft\Active Setup\Installed Components
Delete the directories for OneDrive under all user profiles (especially your Default user profile) and %ProgramData%. Also delete C:\OneDriveTemp.
If you want to remove the OneDrive links from File Explorer delete the two following registry keys if they exist:
I script this all in one .bat file that I run during my image setup. Feel free to do the same.
Working on this problem with windows 10 build 1803
You can also delete the run registry key in the default profile
reg load "hku\Profile" "c:\users\Default User\NTUSER.DAT"
reg delete "hku\Profile\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDriveSetup /f
reg unload "hku\Profile"
After deleting the OneDriveSetup key and doing a re-deploy, the Onedrivesetup.exe process will not be loaded.
We ran into this as well and did what kevinpower suggested initially and it tested fine. As we have some users who may use OneDrive in the near future, we ended up just disabling the OneDriveSetup from running through group policy so that we can still use OneDrive later if needed.
You also have the option to change the install method to a system based installation. You need to install OneDrive in your golden image using the /allusers commandline switch and make use of a specific OneDrive version or newer: Install the sync client per machine | Microsoft Docs
This way Onedrive won't be automatically installed one every user login/profile creation.
This option is in preview, so might have issues (although i haven't seen any)
The option to install onedrive on machine base works fine here, we faced some issues with saving the user configs with the result that sometimes the content of the user will be deleted in the cloud without a manual action pfffff....
For more information on that Has anyone successfully installed the OneDrive for Business Client in a non-persistent VDI environme...
the option to install onedrive on machine based is one step forward so that is good news