Just wondering if anyone can successfully uninstall OneDrive using PowerShell on Windows 10/11. The uninstall flag on the executable doesn't remove it even if processes are killed first.
OneDriveSetup.exe /uninstall
The command doesn't appear to be doing anything. Need to uninstall the OneDrive that comes with the OS to install it in a way that its compatible using the machine wide installer Azure Virtual Desktop/AllUsersInstall. Manually uninstalling from control panel works but I need an unattended uninstall for Azure Image Builder.
Appreciate the help
I removed onedrive using powershell as follow:
By default, OneDrive is installed per user on all supported versions of Windows. But it can be installed per machine.
To find the uninstall command (string) for your system, you can look into the registry:
Per user installation:
Then you can use Powershell to uninstall it using the commands as in the previous answer:
If the key is not present, most probably OneDrive is installed per computer so have a look here:
Per machine installation: (may vary depending on OneDrive version and flavor)
Additional information can be found here:
https://docs.microsoft.com/en-us/onedrive/per-machine-installation