Skip to content

Commit 453e451

Browse files
authored
AB#5401 Update mapped-network-drive-fail-reconnect.md
1 parent 4dc9121 commit 453e451

File tree

1 file changed

+22
-3
lines changed

1 file changed

+22
-3
lines changed

support/windows-client/networking/mapped-network-drive-fail-reconnect.md

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
title: Mapped network drive may fail to reconnect in Windows 10, version 1809
33
description: An article provides a workaround to resolve mapped network drives not working in Windows 10, version 1809.
4-
ms.date: 01/15/2025
4+
ms.date: 04/14/2025
55
manager: dcscontentpm
66
audience: itpro
77
ms.topic: troubleshooting
@@ -51,9 +51,9 @@ while($True){
5151
foreach( $MappedDrive in $MappedDrives)
5252
{
5353
try {
54-
New-SmbMapping -LocalPath $MappedDrive.LocalPath -RemotePath $MappedDrive.RemotePath -Persistent $True
54+
New-SmbMapping -LocalPath $MappedDrive.LocalPath -RemotePath $MappedDrive.RemotePath -Persistent $True -ErrorAction Stop
5555
} catch {
56-
Write-Host "There was an error mapping $MappedDrive.RemotePath to $MappedDrive.LocalPath"
56+
Write-Host "There was an error mapping $($MappedDrive.RemotePath) to $($MappedDrive.LocalPath)"
5757
}
5858
}
5959
$i = $i - 1
@@ -97,3 +97,22 @@ All workarounds should be executed in standard user security context. Executing
9797
9. In the **Start in (optional)** field, type the location (_%SystemDrive%\\Scripts\\_) of the script file.
9898
10. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**.
9999
11. Log off, and then log back on to the device to run the scheduled task.
100+
101+
#### Workaround 3: Create a scheduled task for Microsoft VPN Client EventID 20225(VPN Connection Successfully established)
102+
103+
1. Copy the script file MapDrives.ps1 to the following location:
104+
%SystemDrive%\\Scripts\\
105+
2. In **Task Scheduler**, select **Action** > **Create Task**.
106+
3. On the **General** tab in the **Create Task** dialog box, type a name (such as *Map Network Drives*) and description for the task.
107+
4. Select **Change User or Group**, select a local user or group (such as **LocalComputer\\Users**) and then select **OK**.
108+
5. On the **Triggers** tab, select **New**, and then select **On an event** for the **Begin the task** field.
109+
6. On the **Triggers** tab, select **Log**, and then select **Application** from the **Log** dropdown list.
110+
7. On the **Triggers** tab, Type **RasClient** for the **Source** field.
111+
8. On the **Triggers** tab, Type **20225** for the **Event ID** field and then select **OK**.
112+
9. On the **Actions** tab, select **New**, and then select **Start a program** for the **Action** field.
113+
10. Type *Powershell.exe* for the **Program/script** field.
114+
11. In the **Add arguments (optional)** field, type the following:
115+
*-windowsstyle hidden -command .\\MapDrives.ps1 >> %TEMP%\\StartupLog.txt 2>&1*
116+
12. In the **Start in (optional)** field, type the location (*%SystemDrive%\\Scripts\\*) of the script file.
117+
13. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**.
118+
14. Log off, and then log back on to the device to run the scheduled task.

0 commit comments

Comments
 (0)