Table of Contents
When you are mapping OneDrive to a network drive in Windows 10/11, you may receive one of the following error messages:
Access Denied. Before opening files in this location, you must first add the web site to your trusted site list, browse to the web site, and select the option to login automatically
The root of the issue is you must occasionally connect to the OneDrive site by using Internet Explorer and select the Stay signed in option. This prevents the authenticated session from expiring. Mapping OneDrive to a network drive only completed when these steps are performed within Internet Explorer.
Authenticate to Microsoft 365 and SharePoint Online
1. Open Internet Explorer then paste your OneDrive for Business link into the address bar and hit Enter.
2. Make sure that you’re authenticated to Microsoft 365. To do this, sign into the OneDrive site by using your Microsoft 365 work or school account credentials, and make sure that you select the Stay signed in option.
Add your SharePoint Online sites to trusted sites
Microsoft Edge by default doesn’t support trusted websites feature, but you can add trusted websites from Internet Options and that should affect Edge as well.
Make sure that the SharePoint Online URLs have been added to your Trusted sites zone in Internet Explorer. To do this, follow these steps:
1. Open the Internet Options by search internet options then open it.
Alternatively, you can open the Internet Options window by doing the following:
- Press to open the Run window.
- Enter inetcpl.cpl and press Enter or click OK.
- Internet Properties window will now appear.
2. Select the Security tab, select Trusted sites, and then select Sites.
3. In the Add this website to the zone box, type the URL for the site that you want to add to the Trusted sites zone, and then select Add.
Add the Url https://*.sharepoint.com as per below screenshot:
4. After you have added each site to the Websites list, select Close, and then select OK.
Alternatively, if you don’t want to do it manually. You can open an elevated PowerShell window then execute the following commands at once to add a trusted site automatically:
Set-Location "HKCU:\Software\Microsoft\Windows\CurrentVersion\Internet Settings"
New-ItemProperty . -Name https -Value 2 -Type DWORD
Finally, trying to map your OneDrive for Business into a network drive to verify it works.