Then test this task by rebooting the system. Note: The amal.ovpn is the vpn configuration file and is located in the OpenVPN config directory which defaults to “C:\Program Files\OpenVPN\config”Īfter configuring this, click on ok and save the task. If the above command is working fine, complete the action configuration and save the details. The “amal.ovpn” can be replaced with your vpn config file name. To test this command, the simple thing that we can do is by directly executing the command in the command line (Powershell is recommended).Įg: Go to the bin directory of OpenVPN (C:\Program Files\OpenVPN\bin) and open powershell there.Įxecute the following command. If we miss this argument, the openvpn auto connect will not work. Here my config file name is amal.ovpn and it is located in the config directory of openvpn installation. We need to specify the config file in which we need to connect. Our program is the openvpn client. Browse to the openvpn client installation and select the openvpn-gui.exe. The main part is the arguments section. Here we need to select action as “Start a program”. This is the action that gets triggered by the task. Further tweaking can be made by setting the parameters in the advanced settings section. This means the task will be triggered during the startup of the system. We will configure the trigger details in this section. Click on New and create a trigger as explained in the next step. We need to create a new Trigger for this task. Trigger is basically the parameter that tells the system when to trigger this action. Start create the task by filling the following details in the General section. Select Create Task option to create a new task. Once you open the Task Scheduler, you can see several options. Search for Task Scheduler and Open the Task Scheduler My operating system was Windows 10 (The same steps will work in all the recent versions of windows) I created a task in the windows task scheduler. Here is the steps that I followed to achieve this. So if someone turns off the desktop, during reboot, the vpn needs to be autoconnected so that I can access it from my network without any assistance from others. The desktop will be accessible only through my vpn. I have a desktop server which is located remotely and I want to access it from my laptop. Sometimes we may came across situations in which we need to enable vpn auto connect on the system boot. Restart the server and you will see VPN Connected By Default.Generally we establish VPN connection using OpenVPN using the connect option present in GUI application. Now go to VPN Connection Disconnect it and you will see it reconnects automatically. Now click OK and Create Task It will appear Tasks List. In "Action:" it should be Start a Program then In "Program/Script:" Click Browse and Choose rasdial.exe Its path will appear as it is present inside "System32" folder.Now you need to add name of VPN and credentials in "Add arguments (optional)" in following order Click on Next Tab named "Action" and then Click New, Another Popup will appear. This will add two triggers for our Tasks. On Top again Select "Begin The Task" Drop Down Menu and choose "On an Event" then In "Log:" Choose "Microsoft-Windows-NetworkProfile/Operational", In "Source:" choose "NetworkProfile", In "EventID:" choose "10000" and then click OK like below On Top Select "Begin The Task" Drop Down Menu and choose "On an Event"īelow List will change In "Log:" Choose "Application", In "Source:" choose "RasClient", In "EventID:" choose "20226" and then click OK like belowĪgain click on "New" and add another Trigger. Fill in information like belowĪfter that go to Trigger Tab and Select "New". POPUP will appear asking for Task Information. Open "Task Scheduler" from Start Menu and click "Create Task" (Option can be found on right side of Task Scheduler) Make VPN Connection and give it Some Name Let say "My VPN"
0 Comments
Leave a Reply. |