Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Windows 10 / Could not Reconnect All Mapped Network Drives on Windows 10

February 27, 2023 Windows 10

Could not Reconnect All Mapped Network Drives on Windows 10

Recent builds of Windows 10 have a bug due to which mapped network drives may fail to automatically reconnect at Windows startup. After logging in the user sees a big red cross on the icons of all mapped network drives in File Explorer. If you run the net use command in the command prompt, then you will see the Unavailable status in front of all mapped drives. Both user-mapped network drives and GPO-mapped drives are not automatically reconnected.

This issue first appeared on Windows 10 1809, but it occurs in newer builds, including Windows 10 2004.

Contents:
  • Mapped Network Drives Not Reconnecting in Windows 10
  • Auto Reconnect Mapped Network Drives using PowerShell
  • Automatic Reconnection of Mapped Drives via GPO
  • Mapped Network Drive May Fail to Reconnect on Windows 10 2004 (20H2)
  • Delay Mapping Network Drives in Windows via GPO
  • Disable Could Not Reconnect All Network Drives Notification

Mapped Network Drives Not Reconnecting in Windows 10

Windows 10 for some reason stops automatically mapping network drives after restarting the device. Mapped network drives are displayed in File Explorer, but you cannot connect to them.

A red "X" appears in the icon for a mapped network drive in windows 10 18093

In this case, a pop-up window appears in the notification area with the alert:

Could not reconnect all network drives.
Click here to check the status of your network drives.

Could not reconnect all network drives in windows 10

The problem occurs both with mapped drives connected from NAS devices, and with shared folders on other Windows / Linux computer. This bug first appeared in Windows 10 version 1809 and, according to Microsoft, was fixed by the KB469342 update released on December 5, 2018 (addresses an issue that may cause mapped drives to fail to reconnect after starting and logging onto a Windows device). But the problem occurs in new Windows 10 builds as well.

You can manually download and install the update from the Microsoft Update Catalog.

Microsoft also offers a workaround to the problem of restoring connectivity to the mapped network drives (see KB4471218 — Mapped network drive may fail to reconnect in Windows 10, version 1809). To do this, it is suggested to run a PowerShell script at user logon. If network drives are connected via Group Policy, you need to change the GPO settings.

Auto Reconnect Mapped Network Drives using PowerShell

Let’s look at how to use a PowerShell script to automatically reconnect mapped network drives when a user logs on to Windows.

Run the notepad.exe, copy the following PowerShell code into it, and save the file to the C:\PS directory as MapDrives.ps1:

$i=3
while($True){
$error.clear()
$MappedDrives = Get-SmbMapping |where -property Status -Value Unavailable -EQ | select LocalPath,RemotePath
foreach( $MappedDrive in $MappedDrives)
{
try {
New-SmbMapping -LocalPath $MappedDrive.LocalPath -RemotePath $MappedDrive.RemotePath -Persistent $True
} catch {
Write-Host "Shared folder connection error: $MappedDrive.RemotePath to drive $MappedDrive.LocalPath"
}
}
$i = $i - 1
if($error.Count -eq 0 -Or $i -eq 0) {break}
Start-Sleep -Seconds 30
}

MapDrives.ps1: powershell script to reconnect mapped drives

This script selects all inaccessible mapped drives and tries to reconnect them in persistent mode.

Create another MapDrives.cmd script file with the following code:
PowerShell -Command "Set-ExecutionPolicy -Scope CurrentUser Unrestricted" >> "%TEMP%\StartupLog.txt" 2>&1
PowerShell -File "%SystemDrive%\PS\MapDrives.ps1" >> "%TEMP%\StartupLog.txt" 2>&1

This code allows you to bypass the PowerShell execution policy and run the PS1 script described above. You can put this batch file into the user’s startup by copying the MapDrives.cmd file to the %ProgramData%\Microsoft\Windows\Start Menu\Programs\StartUp folder.

You can also create a scheduled task to run the MapDrives.cmd file when a user logs on. You can create a scheduler task using PowerShell or from the Task Scheduler GUI console (Taskschd.msc).

  1. Create a new task, specify its name (reMapNetworkDrives), select that the task needs to be run on behalf of the Builtin\Users group; reMapNetworkDrives using task Scheduler
  2. On the Triggers tab, select that the task should run when any user logs on to the system (At logon -> Any user);
  3. On the Actions tab, in the Program/script field, specify the path to the MapDrives.cmd file;
  4. On the Conditions tab you can enable the options Network -> Start only if the following network connection is available -> Any connection; Start task only if the following network connection is available
  5. Reboot the computer or logoff/logon under your user account. When the user logs in, the script should run, which will re-create all mapped drive connections.
Please note that by default network drives connected in the elevated mode are not available in normal mode and vice versa. But you can fix it – see the article Mapped drives are not available from the elevated apps.

Automatic Reconnection of Mapped Drives via GPO

If you map network drives to users using domain Group Policies, you need to change the policy settings in order to connect the drives correctly.

Open the GPO that connects the drives, and in the section User Settings -> Preferences -> Windows Settings -> Drive maps, find your network drive assignment policy (policies) and change the Action type from Update to Replace

GPP policy to map shared network folders to drive

After updating the Group Policy settings on clients, the mapped network drives will be removed and reconnected when the user logs on.

Mapped Network Drive May Fail to Reconnect on Windows 10 2004 (20H2)

The problem with mapping network drives also occurs on Windows 10 2004 (build 20H2). The problem arises with network drives connected from legacy network devices that support only the SMBv1 protocol (Windows XP/2003, old NAS devices).

In order to fix this problem, you need to add the parameter ProviderFlags=1 to the user registry for each mapped network drive.

For example, if the user has a network drive U: mapped in the session, go to the registry key HKEY_CURRENT_USER\Network\U. Create a DWORD named ProviderFlags with a value of 1.

Or run the command:

REG ADD "HKCU\Network\U" /v "ProviderFlags" /t REG_DWORD /d "1" /f

map network drives from smbv1 devices with the ProviderFlags registry parameter

Delay Mapping Network Drives in Windows via GPO

Windows may try to reconnect network drives at user logon before the network interface is fully initialized. To prevent mapped drives from connecting until the network is fully enabled, you can configure a specific Group Policy setting.

You can configure this setting through the Local Group Policy Editor (gpedit.msc) or from the Domain GPO Editor (gpmc.msc). Go to Computer Configuration -> Administrative Templates -> System -> Logon and enable the Always wait for the network at computer startup and logon policy.

enable windows gpo parameter "Always wait for the network at computer startup and logon"

Reboot your computer.

You can also fix this problem if you just wait 15 seconds after booting your computer (or exiting from the hibernation/sleep mode) before logging in. This time will be sufficient for Windows to initialize the network.

Disable Could Not Reconnect All Network Drives Notification

If your computer is located not on the corporate network (network drives are not available by design), and you are bothered by the annoying “Could not reconnect all network drives” notification every time Windows boots, you can disable it.

To do this, go to the registry key HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\NetworkProvider, and create a new DWORD parameter with the name RestoreConnection and value 0.

disabling couldnt reconnect network drives notification on windows 10

6 comments
2
Facebook Twitter Google + Pinterest
previous post
Parted: Create and Manage Disk Partitions on Linux
next post
Using PowerShell Just Enough Administration (JEA) to Delegate Privileges to Non-Admin Users

Related Reading

How to Connect VPN Before Windows Logon

November 14, 2023

Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

November 7, 2023

Zabbix: How to Get Data from PowerShell Scripts

October 27, 2023

Tracking Printer Usage with Windows Event Viewer Logs

October 19, 2023

How to Use Ansible to Manage Windows Machines

September 25, 2023

6 comments

dk November 29, 2018 - 11:03 am

KB4469342 – fix for the Mapped Network drive bug in Windows 10 1809:
Addresses an issue that may cause mapped drives to fail to reconnect after starting and logging onto a Windows device

Reply
Shashaank Agarwal December 28, 2018 - 10:25 am

I got the solution of WIndows 10 map network drive connect.
Please install MediaCreationTool1809 and switch on firewell setting. then restart your system.
You’ll got activate your map network drive.

Reply
Jo May 22, 2020 - 2:10 pm

This does not work at all.

Reply
Shashaank Agarwal May 25, 2020 - 10:51 am

i tried and its working
install https://go.microsoft.com/fwlink/?LinkId=691209
MediaCreationTool1809 and install it after installation just check your network setting and allowed to network sharing.
now check it’s work fine.

Reply
ed March 29, 2021 - 6:14 pm

Here it is March 2021 and I’m landing back on this page, so obviously Microsoft as usual can’t make a fix and keep it fixed. This one described above actually worked for me. One tweak I had to discover on my own was to ensure the user credentials were added as windows credentials. Group policy notes above should be called out as not available without additional hacking up windows on home edition. I just don’t get how microsoft can’t do the simple things reliably in this day and age. Power plan settings, need I say more.

Reply
Czeslaw September 7, 2021 - 10:03 am

In my opinion, the problem will be solved if you add a .bat file in the boot menu and use the “net use” command with the “/ persistent: no” option. This will cause that the disk will not be remembered after logging out, but added again every time you log in. In my case, WIN10 no longer causes a drive mapping error.

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • How to Repair EFI/GPT Bootloader on Windows 10 or 11
  • How to Restore Deleted EFI System Partition in Windows
  • Network Computers are not Showing Up in Windows 10/11
  • Updating List of Trusted Root Certificates in Windows
  • How to Create a Wi-Fi Hotspot on your Windows PC
  • How to Sign an Unsigned Device Driver in Windows
  • How to Download APPX File from Microsoft Store for Offline Installation?
Footer Logo

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


Back To Top