Windows OS Hub
  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux
  • Home
  • About

Windows OS Hub

  • Windows
    • Windows 11
    • Windows Server 2022
    • Windows 10
    • Windows Server 2019
    • Windows Server 2016
  • Microsoft
    • Active Directory (AD DS)
    • Group Policies (GPOs)
    • Exchange Server
    • Azure and Microsoft 365
    • Microsoft Office
  • Virtualization
    • VMware
    • Hyper-V
  • PowerShell
  • Linux

 Windows OS Hub / Azure and Microsoft 365 / Mapping SharePoint Online Library as Network Drive in Windows

July 16, 2024

Mapping SharePoint Online Library as Network Drive in Windows

Connecting SharePoint Online document libraries through the OneDrive client or using the Web interface are the preferred and recommended ways to access document library files on SharePoint. But you can also mount SharePoint Online and OneDrive site libraries in Windows as regular network drives. You can map a SharePoint Online network drive manually or by GPO.

Contents:
  • How to Manually Map a SharePoint Online Site as a Network Drive
  • Mapping SharePoint Online Library Using GPO

The WebDAV protocol can be used to access SharePoint Online document libraries over HTTPS. This requires the WebClient service to be running in Windows.

Check that the service is running and, if necessary, configure it to start automatically:
Get-Service webclient
Set-Service webclient –startuptype automatic –passthru

check webdav client status on windows

Windows 10 and 11 have the WebDAV client built into the OS, but Windows Server 2022/2019/2016 requires a separate feature installation:

Install-WindowsFeature WebDAV-Redirector –Restart

This will install two new services:

  • WebClient
  • MRxDAV – WebDAV file system driver

How to Manually Map a SharePoint Online Site as a Network Drive

To manually map a SharePoint Online document library in Windows, open File Explorer, right-click This PC, and select Map Network Drive.

Map network drive via File Explorer GUI

Select a drive letter and specify the HTTPS path to the target SharePoint site (for example, https://woshub.sharepoint.com/sites/company/Shared%20Documents/General). Enable the Reconnect at sign-in option if required.

Map SharePoint online library as a network drive over SSL

However, an error occurs when connecting the network drive:

The mapped network drive could not be created because the following error has occurred:
Access Denied. Before opening files in this location, you must first add the web site to your trusted site list, browse to the web sites, and select the option to login automatically.

mapped network drive could not be created, add the web site to your trusted site list

To fix this, add your SharePoint site address to the trusted list. Open the Internet Options in the Control Panel (run the inetcpl.cpl command).

Go to the Security tab, select the Trusted sites zone, click Sites, and add the URL address of your SharePoint site.

Add SharePoint Online URL to trusted zone

Then click Custom Level button and change the User Authentication -> Logon value to Automatically logon with current user name and password.

IE: Automatically log in with current user name and password.

Accessing a SharePoint Online site requires a user to obtain a Microsoft Modern Authentication token. So, open your Internet Explorer (IE) browser and go to https://login.microsoftonline.com/

If the IE browser is disabled on your computer, then use the Internet Explorer Compatibility Mode in Edge for Entra ID (Azure AD) authentication. Add your SharePoint URL under edge://settings/defaultBrowser -> Internet Explorer Mode Pages -> Add.

Perform authentication with your Azure (Microsoft 365) account, and check the option Stay signed in.

Microsoft Modern Authentication prompt, Stay signed in

This gives you an Entra ID access token valid for 90 days. If the user session is active, this token is automatically renewed.

SharePoint Online document library connected as network drive

You can also map a SharePoint Online library as a network drive from the command prompt:

net use T: "https://woshub.sharepoint.com/sites/company/Shared Documents/General" /persistent:yes

Or use the New-PSDrive PowerShell cmdlet:

$SPOLibrary = "https://woshub.sharepoint.com/sites/company/Shared Documents/General"
New-PSDrive -name "Z" -Root $SPOLibrary -PSProvider filesystem

An error may occur when mapping a network drive from the command line:

System error 224 has occurred.
Access Denied. Access Denied. Before opening files in this location, you must first add the web site to your trusted site list….

net use System error 224 has occurred. Access Denied

In this case, check that the SharePoint Online site is added to trusted and that you have authenticated with your Microsoft 365 account (or the authentication token may have expired).

An error will occur if the WebDav client is not installed on the computer:

Error code: 0x80070043
The network name cannot be found.

Error code: 0x80070043 The network name cannot be found

Mapping SharePoint Online Library Using GPO

Now let’s look at how to automatically map a network drive for a SharePoint Online site using Group Policies.

Create a new policy and assign it to the OU containing the target computers on which you want to mount the SharePoint drive.

  1. Open the Group Policy Management snap-in (gpmc.msc);
  2. Create a new GPO and link it to the OU with the computers on which you want to mount the SharePoint drive;
  3. Navigate to Computer Configuration -> Policies -> Administrative Templates -> Windows Components -> Internet Explorer -> Internet Control Panel -> Security Page
  4. Enable the policy Site to Zone Assignment List and add the following URLs to the trusted list (code 2):https://woshub.sharepoint.com/
    https://login.microsoft.com
    https://portal.office.com
    https://login.microsoftonline.com/
    Configure Site to Zone Assignment List policy, add SharePoint URLs
  5. Then go to the Trusted Sites Zone section and enable the policy Logon options. Select the option Automatic logon with current username and password. GPO: Automatic logon with current username and password
  6. Next, to enable users to authenticate in Microsoft 365 via IE, you’ll need to install administrative (ADMX) templates for MS Edge and copy them to the central GPO store.
  7. Go to Computer Configuration -> Administrative Templates -> Microsoft Edge. Enable the policy Configure Internet Explorer Integrations and set it to Internet Explorer Mode; Enable Internet Explorer Mode for Edge in GPO
  8. Install the Enterprise Mode Site List Manager v2 tool (https://www.microsoft.com/en-us/download/details.aspx?id=49974) and generate the XML file containing the following settings:
    URL: woshub.sharepoint.com
    Open in: IE 11
    Default: Compat modeCreate Enterprise Mode Site List for EdgeSave the file to the NetLogon folder on the domain controller (for example, \\woshub.loc\NETLOGON\edge_iemode_sharepoint.xml)
  9. Open the GPO policy Configure the Enterprise Mode Site List. Enable it and specify the UNC path to the XML file containing the list of sites you created earlier.
    Configure the Enterprise Mode Site List via GPO
  10. Enable the following policies to disable unnecessary prompts the first time you run the Edge browser:
    – Hide the one-time redirection dialog and the banner on Microsoft Edge
    – Hide the first-run experience and splash screen
    Hide first-run experience on Microsoft Edge
  11. To show the Microsoft Modern Authentication prompt when a user logs on, enable the msedge.exe process to start automatically using the Run these programs when the user logs on policy (Computer Configuration -> Administrative Templates -> System -> Logon); GPO: AutoStart the edge.exe
  12. Then go to Microsoft Edge -> Start, home page and new tab. Enable the policies: Actions to take on startup: Open a list of URLs and Sites to open when the browser starts:
    https://login.microsoftonline.com/
    https://woshub.sharepoint.com/
    Edge Group Policy: Sites to open when the browser starts
  13. Now configure the network drive mapping using Group Policy Preferences. Go to User Configuration -> Preferences -> Windows Settings -> Drive Maps. Select New -> Mapped Drive and set the drive map options:
    Action: Update
    Location: https://woshub.sharepoint.com/sites/company/Shared%20Documents/General
    Reconnect: True
    Drive Letter: Show this drive

Map SharePoint Online site via Group Policy

The Microsoft Authentication window will now open when you start the Edge browser. Enter your username and password and confirm login with MFA. End the user session (logoff).
The SharePoint network drive will be automatically mapped via GPO the next time the user logs in.

Some notes about using a SharePoint network drive:

  • Users must periodically (once a month) open the SharePoint Online site in a browser to update the security token.
  • The network drive is only available in an active user session;
0 comment
2
Facebook Twitter Google + Pinterest
Azure and Microsoft 365Group PoliciesPowerShellWindows 10Windows Server 2022
previous post
How to Set (Change) the Default Printer in Windows 10 and 11
next post
Fix: Multiple Connections to a Server or Shared Resources by the Same User

Related Reading

Automatic Outlook User Profile Configuration with ZeroConfigExchange

May 21, 2024

PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

March 17, 2024

How to Export MS Teams Chat History with...

March 12, 2024

Removing Azure Arc Setup Feature on Windows Server...

November 9, 2023

Send Emails with Microsoft Graph API and PowerShell

March 17, 2024

How to Query and Change Teams User Presence...

March 11, 2024

Create a No-Reply Email Address in Exchange Server/Microsoft...

March 15, 2024

Disable Welcome Message for Microsoft 365 Groups

March 17, 2024

Leave a Comment Cancel Reply

join us telegram channel https://t.me/woshub
Join WindowsHub Telegram channel to get the latest updates!

Recent Posts

  • Map a Network Drive over SSH (SSHFS) in Windows

    May 13, 2025
  • Configure NTP Time Source for Active Directory Domain

    May 6, 2025
  • Cannot Install Network Adapter Drivers on Windows Server

    April 29, 2025
  • Change BIOS from Legacy to UEFI without Reinstalling Windows

    April 21, 2025
  • How to Prefer IPv4 over IPv6 in Windows Networks

    April 9, 2025
  • Load Drivers from WinPE or Recovery CMD

    March 26, 2025
  • How to Block Common (Weak) Passwords in Active Directory

    March 25, 2025
  • Fix: The referenced assembly could not be found error (0x80073701) on Windows

    March 17, 2025
  • Exclude a Specific User or Computer from Group Policy

    March 12, 2025
  • AD Domain Join: Computer Account Re-use Blocked

    March 11, 2025

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Automatic Outlook User Profile Configuration with ZeroConfigExchange
  • Configuring Password Policy in Microsoft Entra ID
  • Send Emails with Microsoft Graph API and PowerShell
  • Prevent Users from Creating New Groups in Microsoft 365 (Teams/Outlook)
  • Sending an E-mail to a Microsoft Teams Channel
  • Fix: “Something Went Wrong” Error When Installing Teams
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)
Footer Logo

@2014 - 2024 - Windows OS Hub. All about operating systems for sysadmins


Back To Top