OneDrive, if you’re not using it, it’s just another annoying thing in Windows 10. If you’re able to use it, awesome. But for those environments that want it gone, here is how I’ve removed it from our environment. I’m using several methods to attack this thing to drive it into submission.
Update – 9/19/16 – With 1607, the Group Policy has improved, and this can be basically all done using the updated ADMX files for 1607. – Same policy shown in #2
- OSD Steps
- Group Policy
- AppLocker
So, Let me break this down:
- OSD (3 Steps) – Scripts available Here
- Tweak – Remove OneDrive ShellFolder (Command Line Step)
REG ADD “HKCR\CLSID\{018D5C66-4533-4307-9B53-224DE2ED1FE6}\ShellFolder” /V Attributes /T REG_DWORD /D 4035969101 /F
- Tweak – Delete OneDriveSetup registry Key (Command Line Step)
OneDriveRemove\DeleteOneDriveSetup-DefaultUser-RegisteryRun.cmd
Batch File Contents: (mounts Default user Profile, delete the run registry key for OneDrive)
reg.exe load HKEY_LOCAL_MACHINE\defuser c:\users\default\ntuser.dat
reg.exe delete HKEY_LOCAL_MACHINE\defuser\SOFTWARE\Microsoft\Windows\CurrentVersion\Run /v OneDriveSetup /f
reg.exe unload HKEY_LOCAL_MACHINE\defuser
- Tweak – Remove OneDrive App (Command Line Step) – 9/19/16 – Edit, this step is now failing in 1511 & 1607, I’ve set to Continue on Error for now.
%SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall
- Tweak – Remove OneDrive ShellFolder (Command Line Step)
- Group Policy (Make sure you have the latest 1511 ADMX files
- AppLocker (Add to your already implemented AppLocker configuration, not covering that here)
- Deny ONEDRIVESETUP.EXE, in WINDOWS LIVE, from O=MICROSOFT CORPORATION, L=REDMOND, S=WASHINGTON, C=US
After implementing these 3 processes, OneDrive is no longer showing up in our environment.
Nice! I was researching ways to “de-bloat” Win 10 and came upon a bunch of one-liner PS commands. OneDrive was not among the apps listed, so I’ll begin testing this method in my own environment. Cool stuff!
I’d be interested to see your other finds. Always looking for ways to improve our users experience.
I can’t seem to get %SystemRoot%\SysWOW64\OneDriveSetup.exe /uninstall to run using OSD in SCCM 2012 1602. Is that a known issue?
I think you’re right, something has changed, and that step now fails, I’ve changed it to continue on Error. I’m testing now using an Admin Account instead of SYSTEM to see if that resolves it. Otherwise I’ll just remove the Step. In 1607, it’s not an issue with the updated Group Policy management for OneDrive
Any luck under Admin account? Keeps failing in 1709
I have not tried to use an admin account in OSD, it would be a good test.