Onedrive for Business is not easy to handle on a device with multiple users, the normal install behavior on Windows is per user – so every user on the device will get all the binaries from OneDrive for Business install in there local user profile instead of per machine.
The possibility is changed in Sync client build 19.043.0304.0003 or later – but the default behavior is still to install per user in the %localappdata% folder – when “migrating” to er machine OneDrive is installed in %ProgramFiles(x86)% so you only needs one set of binaries per machine.
Why is this a good idea :

  • OneDrive.exe will not be running from the user profile of the user
  • OneDrive.exe when is gets updated it will happens once per machine (So that in the future is it not possible that different user on the same device can be running different versions of OneDrive.exe)

Note: This feature is in preview


How to change OneDrive from user to device with Microsoft Intune:

Start the Microsoft 365 Device Management portal : https://devicemanagment.microsoft.com

  1. Click device Configuration
  2. Click PowerShell scripts
  3. Click Add

OneDrive per machine - Intune - 01a

 

  1. Name: OneDrive per machine
  2. Script location : upload the script

OneDrive per machine - Intune - 02

Assign the Intune PowerShell script to your devices.

##################################################################################################

###################################################################################################

$url = "https://go.microsoft.com/fwlink/?linkid=2083517"
$output = "$ENV:temp" + '\OneDriveSetup.exe'
$O4BPath = "$ENV:localappdata" + 'Microsoft/OneDrive/OneDriveSetup.exe'

#write $O4BPath
#write $output

IF(Test-Path $output)
{

}
ELSE {
Invoke-WebRequest -Uri $url -OutFile $output
}

IF(!(Test-Path $O4BPath))
{
& "$output" + '/allusers'
}
ELSE {

}
<pre>

Link to the script on github

 

Happy testing 🙂


Read more:

Install the sync client per machine (preview)