OneDrive

From Piszczynski

OneDrive

Onedrive sync issues - Reset OneDrive

Use the following command in CMD Prompt:

  • %localappdata%\Microsoft\OneDrive\onedrive.exe /reset


Can also be executed in the "run" window

If getting error of "onedrive cannot connect to windows" use this fix in elevated cmd:

  • netsh int ip reset
  • netsh winsock reset


OneDrive Installation

Install in per-machine mode (For Azure Virtual Desktop session hosts)

First, create a location to stage the OneDrive installer. A local disk folder or[\\unc] (file://unc) location is fine.

Download OneDriveSetup.exe to your staged location.

If you installed Office with OneDrive by omitting <ExcludeApp ID="OneDrive" /, uninstall any existing OneDrive per-user installations from an elevated command prompt by running the following command:

  • "[staged location]\OneDriveSetup.exe" /uninstall

Run this command from an elevated command prompt to set the AllUsersInstall registry value:

  • REG ADD "HKLM\Software\Microsoft\OneDrive" /v "AllUsersInstall" /t REG_DWORD /d 1 /reg:64

Run this command to install OneDrive in per-machine mode:

  • Run "[staged location]\OneDriveSetup.exe" /allusers

Run this command to configure OneDrive to start at sign in for all users:

  • REG ADD "HKLM\Software\Microsoft\Windows\CurrentVersion\Run" /v OneDrive /t REG_SZ /d "C:\Program Files (x86)\Microsoft OneDrive\OneDrive.exe /background" /f

Enable Silently configure user account by running the following command.

  • REG ADD "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /v "SilentAccountConfig" /t REG_DWORD /d 1 /f

Redirect and move Windows known folders to OneDrive by running the following command.

  • REG ADD "HKLM\SOFTWARE\Policies\Microsoft\OneDrive" /v "KFMSilentOptIn" /t REG_SZ /d "<your-AzureAdTenantId>" /f