虽然Azure Connect正在退役,而Azure虚拟网络提供类似功能且速度更快,但我注意到了一些缺点.
Azure Connect能够自动维护连接,用户甚至无需登录.然而,Azure Virtual Network要求用户以交互方式连接/重新连接到VPN.这使得它在生产环境中非常不可用.有没有办法克服这个障碍?
Bas*_*sum 11
要解决此问题,您可以使用rasdial.我第一次使用rasdial遇到了这个问题: 这个系统不支持这个功能.不要被这条消息所迷惑,因为它只是你没有给出正确的语法.
rasdial "Your VPN name" /phonebook:%userprofile%\AppData\Roaming\Microsoft\Network\Connections\Cm\Your-VPN\Your-VPN.pbk"
Run Code Online (Sandbox Code Playgroud)
simpel方法是制作批处理脚本:
SET VPN_NAME=azureVPN
:loop
rasdial %VPN_NAME% /PHONEBOOK:C:\Users\bas\AppData\Roaming\Microsoft\Network\Connections\Cm\%VPN_NAME%\%VPN_NAME%.pbk
timeout 10
goto loop
Run Code Online (Sandbox Code Playgroud)
结果将是:
Connecting to test...
Verifying username and password...
Registering your computer on the network...
Successfully connected to test.
Command completed successfully.
Run Code Online (Sandbox Code Playgroud)
10秒后:
You are already connected to test.
Command completed successfully.
Run Code Online (Sandbox Code Playgroud)
要在计算机启动时启动此脚本,请使用taskscheduler.
这里描述了一个更好的方法: http ://blog.degree.no/2011/10/permanent-vpn-connection-in-windows/(如上所述使用rasdial)
| 归档时间: |
|
| 查看次数: |
4490 次 |
| 最近记录: |