Configure team sites to sync automatically to File Explorer

Copper Contributor

I've seen this shown in a video by Microsoft and the policy is available in my Group Policy editor. He called it Team Site Auto Mount. I have configured the policy, but with no success. Is this feature live yet? Has anyone gotten it to work? Does it matter what type of document library you are using? We are using Office 365 Groups to move our network file shares for each department to the cloud. That is the document library I wish to automatically sync to each users onedrive account in file explorer.

16 Replies
According to the roadmap it’s still in development! No ETA

Adam

Thanks a lot for the reply. I saw that it was in development but was confused when it showed up as a policy I could enabled this week. I didn't know if they would push out a policy that was yet enacted.

Sorry for the miscommunication, there was a slight delay in the roll out of Team Site Automount. It will be rolling out by the end of the year.

Is this still due to be released before the end of the year as we are getting pretty close now (or has it been realised and I've missed it)?

Still for "Insiders" as documents states. And we have December now.

I still can not get this to work? has it been rolled out?

Do we have an ETA on this yet?

I can not get this to work.

I have set up the  GPO according to documentation but nothing happens, for several days.

Im following this:
https://docs.microsoft.com/en-us/onedrive/use-group-policy#configure-team-site-libraries-to-sync-aut...

 

Is this GPO broken?

@Anders Gidlund I am no expert, but I can confirm that this does work. I was able to set it up for about 5 different o365 groups. The sync does not immediately go into effect like most policies. Every time I have done it, I had to wait till the next day to see the library sync on my test computer.

@Jake Turner 

Are there any problems with my formatting? Now I have ran the Powershell code according to the documentation page to fix the encoding. Is it correct that I should have these { and } around the guids?

tenantId={00000000-0000-0000-0000-000000000000}&siteId={00000000-0000-0000-0000-000000000000}&webId={00000000-0000-0000-0000-000000000000}&listId={00000000-0000-0000-0000-000000000000}&webUrl=https://example.sharepoint.com&version=1

 

How hard is the limit of no more than 5000 files/folders in a library? Does OneDrive check and count the objects before syncing? Theres no problem syncing these libraries manually.

@Anders GidlundI didn't alter the library ID that I got from the the admin portal where I clicked "Copy Library ID."   I pasted that straight into my policy and it worked (after letting it sit for several hours.) I have never seen the documentation your referenced. I created this policy about a month ago, so unless something changed, I would just paste the Library ID straight into the policy without altering the characters.

@Anders Gidlund  and @Jake Turner 

 

I had a similar issue and using the work of Dale Hayter , and others I've modified his PowerShell script to give back the same ID that you get if you click Copy id, when you use the Sync button.

 

Here is the script so that it is easier for others to find:

My goal with this was to have a PowerShell way of creating the registry setting for hundreds of teams, so that we could give our users a good experience of having their Organisation Team site's synced to their File Explorer quickly and easily.

 

# source for this script
#		https://www.blackforce.co.uk/2019/09/12/sharepoint-copy-library-id-missing-for-team-site-libraries-sync
#		and
#		https://www.blackforce.co.uk/2019/06/07/automatically-sync-microsoft-sharepoint-team-site-libraries-now-live#comment-4601075707
#	Adapted by Dorje McKinnon to add a variable for the folder, because channels in team sites are specific to folders
#	This script was setup to sync the General channel folder from a departmental team site
#set the following four things for each SharePoint site / library / folder you want the Registry key for to auto sync with OneDrive

#example of the URL I'm synching  https://MyTennant.sharepoint.com/sites/MyDepartment/Shared Documents/General 

$siteName = 'MyDepartment' #Sharepoint site URL
$docLib = 'Documents' #Sharepoint Document Library name not address
$docLibUrl = 'Shared documents' #Sharepoint library URL 
$docLibFolder = 'General'

#>>> everything below here likely stays the same everytime you run the script
# info on howto get your  tennant id
#       https://tomtalks.blog/2015/09/how-to-get-your-office-365-tenant-id/

$tenant = 'MyTennant' # the first part of your tennant name XXXXX.sharepoint.com 
$tenantId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional.


# Connection This didn't work with my setup but may work for you.
#Connect-PnPOnline https://$tenant.sharepoint.com/sites/$siteName -SPOManagementShell


# >>>>  Login using an account with access to the site.

# If you do not have MDA or modern auth then do not use the -SPOManagementShell switch
Connect-PnPOnline https://$tenant.sharepoint.com/sites/$siteName

# Convert Tenant ID
$tenantId = $tenantId -replace '-','%2D'

# Convert Site ID
$PnPSite = Get-PnPSite -Includes Id | select id
$PnPSite = $PnPSite.Id -replace '-','%2D'
$PnPSite = '%7B' + $PnPSite + '%7D'

# Convert Web ID
$PnPWeb = Get-PnPWeb -Includes Id | select id
$PnPWeb = $PnPWeb.Id -replace '-','%2D'
$PnPWeb = '%7B' + $PnPWeb + '%7D'

# Convert List ID
$PnPList = Get-PnPList $docLib -Includes Id | select id
$PnPList = $PnPList.Id -replace '-','%2D'
$PnPList = '%7B' + $PnPList + '%7D'
$PnPList = $PnPList.toUpper()

# end product &folderId=ecc664be%2D3ca0%2D4a7b%2D8ec2%2Dd92be4bf4847
# Convert FolderID ID
$foldertotest = '/sites/'+$siteName+'/'+$docLibUrl+'/'+$docLibFolder

$PnPFolder = Get-PnPFolder -url $foldertotest -Includes UniqueId
$PnPFolder = $PnPFolder.UniqueId -replace '-','%2D'
$PnPFolder = '%7B' + $PnPList + '%7D'
$PnPFolder = $PnPFolder.toUpper()


# Enumerate the Full URL
$FULLURL = 'tenantId=' + $tenantId + '&siteId=' + $PnPSite + '&webId=' + $PnPWeb + '&listId=' + $PnPList + '&folderId=' + $PnPFolder + '&webUrl=https%3A%2F%2F' + $tenant + '%2Esharepoint%2Ecom%2Fsites%2F' + $siteName + '&version=1'

# Output the FULL URL To Copy and Paste
Write-Output 'List ID: ' $FULLURL

 

 

@Dorje McKinnon 

 

I have changed your script a bit to take into account the new powershell - love it when Microsoft change stuff :)

# source for this script
#		https://www.blackforce.co.uk/2019/09/12/sharepoint-copy-library-id-missing-for-team-site-libraries-sync
#		and
#		https://www.blackforce.co.uk/2019/06/07/automatically-sync-microsoft-sharepoint-team-site-libraries-now-live#comment-4601075707
#	Adapted by Dorje McKinnon to add a variable for the folder, because channels in team sites are specific to folders
#	Adapted further by Ian Watson to take into account M$ changing the powershell modules
#	This script was setup to sync the General channel folder from a departmental team site
#set the following four things for each SharePoint site / library / folder you want the Registry key for to auto sync with OneDrive

#example of the URL I'm synching  https://MyTennant.sharepoint.com/sites/MyDepartment/Shared Documents/General 

$siteName = 'MyDepartment' #Sharepoint site URL
$docLib = 'Documents' #Sharepoint Document Library name not address
$docLibUrl = 'Shared documents' #Sharepoint library URL 
$docLibFolder = 'General'

#>>> Clean up old Modules and install the required modules for powershell - click yes to all when prompted
Uninstall-Module -Name SharePointPnPPowerShellOnline -AllVersions -Force
Install-Module -Name PnP.PowerShell

#>>> everything below here likely stays the same everytime you run the script
# info on howto get your  tennant id
#       https://tomtalks.blog/2015/09/how-to-get-your-office-365-tenant-id/

$tenant = 'MyTennant' # the first part of your tennant name XXXXX.sharepoint.com 
$tenantId = 'xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx' #Tenant ID, can be retrieved from Azure AD or PowerShell under optional.

# >>>>  Login using an account with access to the site.

# If you do not have MDA or modern auth then do not use the -SPOManagementShell switch
# You will need to accept the permissions after login if not done already
Connect-PnPOnline https://$tenant.sharepoint.com/sites/$siteName -Interactive

# Convert Tenant ID
$tenantId = $tenantId -replace '-','%2D'

# Convert Site ID
$PnPSite = Get-PnPSite -Includes Id | select id
$PnPSite = $PnPSite.Id -replace '-','%2D'
$PnPSite = '%7B' + $PnPSite + '%7D'

# Convert Web ID
$PnPWeb = Get-PnPWeb -Includes Id | select id
$PnPWeb = $PnPWeb.Id -replace '-','%2D'
$PnPWeb = '%7B' + $PnPWeb + '%7D'

# Convert List ID
$PnPList = Get-PnPList $docLib -Includes Id | select id
$PnPList = $PnPList.Id -replace '-','%2D'
$PnPList = '%7B' + $PnPList + '%7D'
$PnPList = $PnPList.toUpper()

# end product &folderId=ecc664be%2D3ca0%2D4a7b%2D8ec2%2Dd92be4bf4847
# Convert FolderID ID
$foldertotest = '/sites/'+$siteName+'/'+$docLibUrl+'/'+$docLibFolder

$PnPFolder = Get-PnPFolder -url $foldertotest -Includes UniqueId
$PnPFolder = $PnPFolder.UniqueId -replace '-','%2D'
$PnPFolder = '%7B' + $PnPList + '%7D'
$PnPFolder = $PnPFolder.toUpper()


# Enumerate the Full URL
$FULLURL = 'tenantId=' + $tenantId + '&siteId=' + $PnPSite + '&webId=' + $PnPWeb + '&listId=' + $PnPList + '&folderId=' + $PnPFolder + '&webUrl=https%3A%2F%2F' + $tenant + '%2Esharepoint%2Ecom%2Fsites%2F' + $siteName + '&version=1'

# Output the FULL URL To Copy and Paste
Write-Output 'List ID: '
[uri]::UnescapeDataString("$FULLURL")

@BinaryStars many thanks for sharing your update :)