The right way to setup a VPN on windows

Remember that clicking orgy from the last blog post? It seems it is possible to completely script that. No more clicking... (And we can remove the Task Scheduler hack alltogether :) )

Firstly run Powershell as Administrator and update the script execution policy for temporary allowing to run scripts:

Get-ExecutionPolicy -List

Execution policy list

If everything displays Undefined update for running unverified scripts:

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned

Execution policy change

Now collect the machine certificate (p12 file) and the CA root and add the following script:

You have to configure the variables on top before running the script.

If you have finished the setup you may reset the execution policy to the value it was before: Set-ExecutionPolicy -ExecutionPolicy Undefined

Thanks @_Tomalak for sending me the pointers to the right direction :)

Johannes Schriewer

Read more posts by this author.

Augsburg, Germany