Install Office 2016 OneDrive for All Users | Quisitive
Content Migration: OneDrive vs SharePoint vs Teams
Install Office 2016 OneDrive for All Users
November 30, 2016
Matthew Dowst
Read our blog.

I recently ran into an interesting issue when deploying Office 2016 ProPlus on Windows 7. I discovered that the OneDrive application installs under the user context, and not to the system like the rest of the suite does. This is not a big deal if you are using Windows 10, as OneDrive client is built in, but I was deploying to Windows 7 machines. So on Windows 7 only the user who ran the installer would have the OneDrive client installed. If I added a new profile to the machine it would also receive the OneDrive client. But it would not be available to any users with existing profiles on the machine. So to work around this, I created an Active Setup registry key and pointed it to the OneDriveSetup.exe that is installed along with the suite.

Active Setup is used to execute commands once per user during the login process. In this case I am using it to run the OneDriveSetup.exe silently for anyone who logs onto the machine, regardless of whether or not they had an existing profile.

Below is a copy of the PowerShell I used to create the registry entry. I also includes the command line version in case you are using a batch file.

$activeSetupPath = "HKLM:SOFTWAREMicrosoftActive SetupInstalled ComponentsOneDrive" 
IF(!(Test-Path $activeSetupPath)) 
{ 
     New-Item -Path $activeSetupPath -Force | Out-Null 
     New-ItemProperty -Path $activeSetupPath -Name "Version" -Value "1" -PropertyType String -Force | Out-Null 
     New-ItemProperty -Path $activeSetupPath -Name "StubPath" -Value '"C:Program FilesMicrosoft OfficerootIntegrationOneDriveSetup.exe" /silent' -PropertyType String -Force | Out-Null 
} 
   ELSE { 
     New-ItemProperty -Path $activeSetupPath -Name "Version" -Value "1" -PropertyType String -Force | Out-Null 
     New-ItemProperty -Path $activeSetupPath -Name "StubPath" -Value '"C:Program FilesMicrosoft OfficerootIntegrationOneDriveSetup.exe" /silent' -PropertyType String -Force | Out-Null 
}

reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled ComponentsOneDrive" /v "Version" /d "1" /t REG_SZ /f
 
reg add "HKEY_LOCAL_MACHINESOFTWAREMicrosoftActive SetupInstalled ComponentsOneDrive" /v "StubPath" /d "C:Program FilesMicrosoft OfficerootIntegrationOneDriveSetup.exe /silent" /f