Skip to content

Instantly share code, notes, and snippets.

@win2000b
Last active July 5, 2019 07:55
Show Gist options
  • Save win2000b/dc810a4a8369bd72b305fb93f6992430 to your computer and use it in GitHub Desktop.
Save win2000b/dc810a4a8369bd72b305fb93f6992430 to your computer and use it in GitHub Desktop.
AutoMount SharePoint Library via Intune PowerShell
$tenantAutoMountRegKey="HKLM:\SOFTWARE\Policies\Microsoft\OneDrive\TenantAutoMount"
$autoMountTeamSitesList= @{
#Enter your SharePoint libraries to configure here as key/value pairs
Technical="INSERT URL IN HERE"
}
if (-not (Test-Path $tenantAutoMountRegKey)){
New-Item -Path $tenantAutoMountRegKey -Force
}
#add registry entries from the hashtable above
$autoMountTeamSitesList.GetEnumerator() | ForEach-Object {
Set-ItemProperty -Path $tenantAutoMountRegKey -Name $PSItem.Key -Value $PSItem.Value -ErrorAction Stop
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment