Dažādas piezīmes

Auto reconnect VPN in windows 10 RSS šim rakstam 
15:31:33 03/01/2022 iesūtījis hQuse - Sadaļa: hQuse

Simple howto.

No additional third side software required. Windows built-in task scheduler used. Username and password arguments NOT required for command.

This assumes you're using Windows 10 built-in VPN and already saved VPN connection (saved username and password). Probably will work on older Windows versions too.

First of all find saved VPN connection parameters file C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Network\Connections\Pbk\rasphone.pbk

Make backup.

Then open original and find [YOURVPNNAME].

Find PreviewUserPw=1
Change it to PreviewUserPw=0

Save the file.


Next create new file, copy following content, change keywords in CAPITALLETTERS.
<?xml version="1.0" encoding="UTF-16"?>
<Task version="1.2" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
<RegistrationInfo>
<Date>2021-12-30T14:40:51.0713534</Date>
<Author>DOMAIN\YOURUSERNAME</Author>
<URI>\VPN reconnect task</URI>
</RegistrationInfo>
<Triggers>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Application"&gt;&lt;Select Path="Application"&gt;*[System[Provider[@Name='RasClient'] and EventID=20226]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
</EventTrigger>
<EventTrigger>
<Enabled>true</Enabled>
<Subscription>&lt;QueryList&gt;&lt;Query Id="0" Path="Microsoft-Windows-NetworkProfile/Operational"&gt;&lt;Select Path="Microsoft-Windows-NetworkProfile/Operational"&gt;*[System[Provider[@Name='NetworkProfile'] and EventID=10000]]&lt;/Select&gt;&lt;/Query&gt;&lt;/QueryList&gt;</Subscription>
</EventTrigger>
</Triggers>
<Settings>
<MultipleInstancesPolicy>IgnoreNew</MultipleInstancesPolicy>
<DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
<StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
<AllowHardTerminate>true</AllowHardTerminate>
<StartWhenAvailable>false</StartWhenAvailable>
<RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
<IdleSettings>
<StopOnIdleEnd>true</StopOnIdleEnd>
<RestartOnIdle>false</RestartOnIdle>
</IdleSettings>
<AllowStartOnDemand>true</AllowStartOnDemand>
<Enabled>true</Enabled>
<Hidden>false</Hidden>
<RunOnlyIfIdle>false</RunOnlyIfIdle>
<WakeToRun>false</WakeToRun>
<ExecutionTimeLimit>PT72H</ExecutionTimeLimit>
<Priority>7</Priority>
</Settings>
<Actions Context="Author">
<Exec>
<Command>C:\Windows\System32\rasphone.exe</Command>
<Arguments>-d "YOURVPNNAME" -f C:\Users\YOURUSERNAME\AppData\Roaming\Microsoft\Network\Connections\Pbk\rasphone.pbk</Arguments>
</Exec>
</Actions>
</Task>

Next open Windows Task Scheduler and import this file. New task will be created.

Try to Run/Enable it.

Connect/Disconnect VPN.

If setup is correct, VPN should reconnect right after disconnection.

Citi raksta

Pašlaik nav komentāru

Komentēt...

:

:
:


Komentāri rakstiem, kas vecāki par 30 dienām, pirms publicēšanas tiek izskatīti!
Comments on articles older than 30 days are moderated and in many cases NOT PUBLISHED at all!

Šurpu turpu

«« Airam Campus galda lampai kirdik »»

Locations of visitors to this page