

Now we may place this script in a folder like C:\work\bin, create a folder C:\work\log for log records and schedule this script via Task scheduler by condition “On Startup” with a 2 minutes delay (allowing Remote Access and other services to start up after boot) and schedule selfVPNconnect.cmd with redirection >c:\work\log\selfVPNconnect.log 2>c:\work\log\selfVPNconnect_err.log to record the command output.They are tiny app or extensions that curb your distractions by restricting the internet access on your PC or phone. The cmd script selfVPNconnect.cmd that we used contained just one-liner call to RasDial application: rasdial selfVPNconn Nothing should happen, except that your server IP address (172.0.2.1 in our case) would be up.Īfter the first successful connect, storing the user id and password, we were ready to automate this solution. Click on the newly configured “selfVPNconn” and enter the user credentials for it to remember and connect.
#Selfcontrol for windows how to
How to solve this? Simply by inflicting a VPN connection to server from a user session inside the server itself, automatically, right after the server started. We would configure 172.0.2.1 as a universal connection point for all the applications and grant proper server firewall exclusions, though… they would not be able to connect if no external users connected to the VPN service yet. That presented a challenge for application jobs configured to run in both modes: locally on the server and from remote locations connected to the server. The IP address becomes live as soon as first VPN client is connected from outside to the RAS service.

When server just started that IP would be down – not even pingable, let alone not routable. That makes first address of the range, 172.0.2.1 the server’s address that is accessible by VPN clients (inside VPN tunnel). For instance, assume DHCP IP range for VPN clients was 172.0.2.1 – 172.0.2.199.

The only problem was that static IP of the server (as should be seen by a connected user) was not up at all times.
#Selfcontrol for windows windows
Imagine, if there was a Windows 2012 server with its standard VPN service ( RAS, or, Remote Access, actually), configured and operational. There were times when we were looking for simple yet unorthodox solutions and this case was one of them. “Self Control” by Laura Branigan, from album “Self Control” (1984) Task I must believe in something, so I’ll make myself believe it.
