In Windows 10 Onedrive is builtin, in some scenarios you don’t want to use it as, for instance if you use both Onedrive and Onedrive for Business installed as that is confusing for the user. Yes, you can turn of Onedrive using a Group Policy but the Onedrive Setup will run for every user creating a profile on the system anyway. In many scenarios we don’t want it to run at all.
How does this work then? In the default user profile there is a Run Command in the registry the runs for every user creating logging on to the computer.
What we use is the old trick in the book, to mount the default user profile during OS Deployment and simply delete the Run command from the registry then it will not execute at all for any user. We create a .cmd file with the following command lines to first mount the default user registry, remove the command and unmount it.
The .cmd file can be downloaded here: removeOnedrive.cmd
To implement it:
1. Download the file and copy it to a folder that you can use as a package Source for a package in Configuration Manager.
2. Rename the file to “RemoveOneDrive.cmd”
5. Then we distribute the content if you haven’t automated it already like I do 😉 :https://ccmexec.com/2015/08/powershell-automatically-copy-packages-to-dp-in-configuration-manager-2012/
6. Add a step to the Task Sequence to run the command, I like to use the Run Command Line step but you could create a program as well if you like. Note: It has to run after a reboot to the full OS, it cannot be run in WinPE.
Then you are ready to test the deployment.