You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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)"
57
57
}
58
58
}
59
59
$i = $i - 1
@@ -72,28 +72,45 @@ All workarounds should be executed in standard user security context. Executing
72
72
> [!NOTE]
73
73
> This workaround works only for the device that has network access at logon. If the device has not established a network connection by the time of logon, the startup script won't automatically reconnect network drives.
74
74
75
-
1. Copy the script file (MapDrives.cmd) to the following location:
9. In the **Start in (optional)** field, type the location of the script file: **%SystemDrive%\\Scripts\\**.
98
96
10. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**.
99
-
11. Log off, and then log back on to the device to run the scheduled task.
97
+
11. Sign out, and then sign in to the device to run the scheduled task.
98
+
99
+
#### Workaround 3: Create a scheduled task for VPN connection Event ID 20225
100
+
101
+
> [!NOTE]
102
+
> Event ID 20225 indicates that a virtual private network (VPN) connection is successfully established.
103
+
104
+
1. Copy the script file **MapDrives.ps1** to the following location: **%SystemDrive%\\Scripts\\**.
105
+
2. In **Task Scheduler**, select **Action** > **Create Task**.
106
+
3. On the **General** tab in the **Create Task** dialog, 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. Select **Application** from the **Log** dropdown list, type **RasClient** in the **Source** field, and type **20225** in the **Event ID** field. Then, select **OK**.
110
+
7. On the **Actions** tab, select **New**, and then select **Start a program** for the **Action** field.
111
+
8. Type **Powershell.exe** for the **Program/script** field.
112
+
9. In the **Add arguments (optional)** field, type the following:
10. In the **Start in (optional)** field, type the location of the script file: **%SystemDrive%\\Scripts\\**.
115
+
11. On the **Conditions** tab, select the **Start only if the following network connection is available** option, select **Any connection**, and then select **OK**.
116
+
12. Sign out, and then sign in to the device to run the scheduled task.
0 commit comments