Once Upon a Time in the Automount of OneDrive Team Sites

Once Upon a Time in the Automount of OneDrive Team Sites

In this blog, we’ll be talking about how to make sure your team site sync automatically to all your devices within a few minutes. Microsoft offers this option as well, only their solution might take up to 8 hours! Today I’ll show you how to speed up this process. 

I will divide this blog into multiple parts

  1. Configure team site libraries to sync automatically in intune
  2. The problem
  3. Conclusion

1.Configure Team Site libraries to sync automatically

For anyone who wants to sync the team site libraries automatically, you can configure it in Intune.  You can search for “configure team site” in the administrative templates.

Looking at the picture above, you only need to have the Sharepoint Site ID. In the past, you could simply click on sync in SharePoint and press “Copy Library ID”

But that prompt could not be shown! If that’s the case, we need to create it manually. You could do so by pressing F12 to open the developer pane, click on the Network tab and click the clear button to clear previous requests.

Now we have everything in place, press the sync button

We need to add the above settings in this line of text (except the tenant id… but I hope you know how to find that one!)


Here is an example:


2. The problem

Okay, not my cup of tea. I feel users should be able to decide which team sites are important for them. Also, It’s very user-friendly to set up.  

Back to the issue at hand, when you configure the sync through Intune, the whole process could take up to 8 hours. While often users need access to a file or folder within minutes. For most businesses, this is an unacceptable timeframe. 


Now there’s an easy way to make your ever-loving customers very happy. As they’ll have access to their files and folders in explorer within minutes! 

3. The Solution

All we have to do is change the following timerautomount registry key through PowerShell. 


Option 1:

You can push a PowerShell script in Intune to make sure this registry key is changed.  But this will only change the key one time!. After a successful onedrive startup and checking for sites to mount this key will be reset.

PowerShell Script Content: 

reg add “HKCU\Software\Microsoft\OneDrive\Accounts\Business1 /v Timerautomount /t REG_QWORD /d 1 /f 

Option 2:  

If like me, you’re blocking PowerShell… Here’s a quick and easy way to push HKCU changes in the registry while blocking PowerShell.

This option is way better because it will make sure the timerautomount will be reset to zero each time the user logs in or when using proactive remediations after each hour!


Having easy access to files and folders through explorer is still something that a lot of users value. Microsoft’s solution simply takes an unacceptable amount of time for most businesses. If like me, you don’t want to wait 8 hours before having access to your files in explorer… Simply look at the two options I offered above and decides what fits your business best. 

4 thoughts on “Once Upon a Time in the Automount of OneDrive Team Sites

    1. Hi,

      When the timerautomount is processed once, it will be deleted. But why not creating a script like this? To make sure it is set to 0 at each logon

      $content = @’
      Windows Registry Editor Version 5.00

      # create custom folder and write PS script
      $path = $(Join-Path $env:ProgramData CustomScripts)
      if (!(Test-Path $path))
      New-Item -Path $path -ItemType Directory -Force -Confirm:$false
      Out-File -FilePath $(Join-Path $env:ProgramData CustomScripts\onedrive.reg) -Encoding unicode -Force -InputObject $content -Confirm:$false

      # register script to run at logon
      $WshShell = New-Object -comObject WScript.Shell
      $Shortcut = $WshShell.CreateShortcut(“$env:ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp\config.lnk”)
      $Shortcut.TargetPath = ‘”c:\windows\System32\reg.exe”‘
      $Shortcut.Arguments = “import c:\programdata\CustomScripts\onedrive.reg”
      $Shortcut.WorkingDirectory = ‘”c:\programdata\CustomScripts\”‘

  1. We’re rolling out a new site for a department so I think I’m okay with using the admin template and it taking up to 8 hours, but how can I assign that to the Teams site group?

    Looks like Intune won’t let me target any Microsoft 365 groups for Device Configuration profiles. I also can’t add that M365 group to another security group. Do I need to maintain two groups for this?

    1. That’s correct… Security groups define who can access resources, and are recommended for your groups in Intune. So you can’t use Microsoft 365 groups… sometime like 1,5 years ago that option was removed

Leave a Reply

Your email address will not be published. Required fields are marked *

2  +  1  =