Brett Rowberry
Brett Rowberry

Reputation: 1050

Connect to Azure Point to Site VPN via Script

I have a working Azure Point-to-Site VPN on Windows 10.

See this guide for instructions: https://www.starwindsoftware.com/blog/configuring-azure-point-to-site-vpn-with-windows-10

I'd like my computer to make the VPN connection on login. I know how to make Task Scheduler run a script on login. How can I make a script that will perform these two manual steps shown in the image below (mentioned in the article)? VPN Connect Dialogs

Upvotes: 1

Views: 2438

Answers (1)

Nancy Xiong
Nancy Xiong

Reputation: 28224

You can have a try on these commands working for me.

rasphone  "vNet_GET-CMD"
$wshell = New-Object -ComObject wscript.shell;
$wshell.AppActivate('Network Connections')
Sleep 2
$wshell.SendKeys('~')
Sleep 2
$wshell.SendKeys('~')

enter image description here

Upvotes: 3

Related Questions