maciejrebisz.com

IT

How to silently configure OneDrive for Business with Intune – Cloud First

maximios July 22, 2025

When we are doing modern management of Windows 10 devices with AzureAD then sometimes we are missing the easy way from group policies preferences, but in Intune we have the Intune Management extension previous known as Project Sidecar. In basic it is just a way to run a powershell script on a Intune managed devices once.

To silently configure OneDrive for Business there is some pre-requirements

  • The device needs to be AzureAD joined or hybrid AzureAD joined
  • You need to run the latest version of OneDrive for business to ensure that it is working correctly
  • The user need a OneDrive for Business license

We only need to set to regkeys to get this working – but there is no native way of manipulation with the registre database in Windows – so we just do it with powershell.

The 3 regkeys we need to add is:

HKCU:\SOFTWARE\Microsoft\OneDrive\EnableADAL

This one will enable ADAL for OneDrive for business, this needs to be set in the user context.

HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\SilentAccountConfig

This one will enable Silent Account Configuration for OneDrive for business, this needs to be set in the computer context.

HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\FilesOnDemandEnabled

This one will enable files on demand – this will only work on Windows 10 1709, this needs to be set in the computer context.

In a Windows 10 devices that is AzureAD joined and Intune managed – the Intune Management Extension is the easy way to setup OneDrive for Business with Silent Account Configuration.

Start by creating two powershell scripts – one for the HKCU and one for the HKLM.

EnableADAL on Onedrive.ps1 :

$registryPath = "HKCU:\SOFTWARE\Microsoft\OneDrive"
$Name = "EnableADAL"
$value = "1"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null}
ELSE {
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null}

and EnableAutoConfig on Onedrive.ps1 :

 $registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
$Name = "SilentAccountConfig"
$value = "1"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null}
ELSE {
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null}
$registryPath = "HKLM:\SOFTWARE\Policies\Microsoft\OneDrive"
$Name = "FilesOnDemandEnabled"
$value = "1"
IF(!(Test-Path $registryPath))
{
New-Item -Path $registryPath -Force | Out-Null
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null}
ELSE {
New-ItemProperty -Path $registryPath -Name $name -Value $value `
-PropertyType DWORD -Force | Out-Null} 

How to setup it up in Intune:

Start the Intune Portal in Azure – https://portal.azure.com

  1. Click Device configuration
  2. Click PowerShell scripts
  3. Click Add

  1. Name : OneDrive Enable ADAL
  2. Script location: Browse and import the “EnableADAL on Onedrive.ps1″ script
  3. Click Configure
  4. Click Run this script using the logged on credentials = Yes

  1. Name : Onedrive – Enable AutoConfig
  2. Script location: Browse and import the “EnableAutoConfig on Onedrive.ps1” script

How does this look from the client side:

The user is logging in at the device first time after AzureAD join

OneDrive for Business client is prompting the end user “You are now syncing” on this PC

Because File On-Demand is enabled OneDrive for Business is total silent configured

In OneDrive settings – Settings blade you can see that File On-Demand is enabled on this PC

In settings – account blade of the OneDrive for Business you can see that the logged on user to the Windows 10 Device is linked to this PC

Read more at:

Use Group Policy to control OneDrive sync client settings

(Preview) Silently configure OneDrive using Windows 10 or domain credentials

Previews for Silent Sync Account Configuration and Bandwidth Throttling for OneDrive

Learn about OneDrive Files On-Demand

Related Posts

IT /

Intune – Windows device enrollment restrictions – Cloud First

IT /

How to add “hidden” Windows UWP to Windows Store for Business – Cloud First

IT /

Office 2016 Active Directory-Based activation – Cloud First

‹ Demystifying Windows Autopilot hardware hash and Autopilot diagnostic tools – Cloud First › How to use Aaronlocker with Microsoft Intune – Cloud First

Recent Posts

  • Intune – Windows device enrollment restrictions – Cloud First
  • How to add “hidden” Windows UWP to Windows Store for Business – Cloud First
  • Office 2016 Active Directory-Based activation – Cloud First
  • How to deploy Windows Local Experience Packs with Intune – Cloud First
  • Conditional Access for Outlook Web Access (OWA) – Cloud First

Recent Comments

No comments to show.

Archives

  • November 2025
  • October 2025
  • August 2025
  • July 2025
  • June 2025
  • April 2025
  • March 2025
  • February 2025
  • January 2025
  • November 2024
  • September 2024
  • July 2024
  • June 2024
  • March 2024
  • December 2023
  • August 2023
  • June 2023
  • March 2023
  • February 2023
  • December 2022
  • September 2022
  • August 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • January 2022
  • December 2021
  • October 2021
  • September 2021
  • August 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • February 2020
  • January 2020
  • December 2019
  • October 2019
  • September 2019
  • June 2019
  • April 2019
  • March 2019
  • February 2019
  • March 2018
  • February 2018
  • December 2017
  • October 2017
  • August 2017

Categories

  • IT

Back to Top

© maciejrebisz.com 2026
Powered by WordPress • Themify WordPress Themes