[Last Call] Learn about multicloud storage options and how to improve your company's cloud strategy. Register Now

x
?
Solved

Connect to existing VPN connection using PowerShell

Posted on 2010-09-15
4
Medium Priority
?
13,471 Views
Last Modified: 2012-08-13
I am doing some systems automation with powershell and have a situation where I need to connect to several different VPN connections based on the remote servers I need to work with.  

Since we can not (for security reasons) leave the VPN connections open, I just want to open the VPN session using PowerShell and when the processes are done, close the connection.

The VPN is a standard MS VPN connection on Windows 7 or Windows Server 2008 (& 2008 R2)
The VPN connections have already been configured, so I just simply need to connect.

I am hoping someone can steer me in the right direction on how to open and close connection.

Thanks!

0
Comment
Question by:TriadX1
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
4 Comments
 
LVL 9

Expert Comment

by:Sander Stad
ID: 33689310
Microsoft has written an article about this on technet. You can look it up in here: http://technet.microsoft.com/en-us/library/ee431700(WS.10).aspx

You don't have to create the scripts yourself because you can download them at: http://www.microsoft.com/downloads/en/details.aspx?FamilyID=ce82bbd3-948b-476b-ab2e-1a1696349905&displaylang=en

0
 
LVL 1

Author Comment

by:TriadX1
ID: 33689341
I am not trying to deploy a new VPN connection. I am trying to connect to an previously deployed connection via powershell.
0
 
LVL 71

Accepted Solution

by:
Qlemo earned 2000 total points
ID: 33696338
With the Command Prompt, you just use rasdial. You can do the same from PowerShell. RasDial allows for providing data via commandline, but you do not need to:

rasdial VPN1        will "dial", i.e. start the RAS connection entry named VPN1
rasdial VPN1 /d    will stop the VPN
1
 
LVL 1

Author Closing Comment

by:TriadX1
ID: 33698866
Perfect!!!! Works just fine!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

My attempt to use PowerShell and other great resources found online to simplify the deployment of Office 365 ProPlus client components to any workstation that needs it, regardless of existing Office components that may be needing attention.
For anyone that has accidentally used newSID with Server 2008 R2 (like I did) and hasn't been able to get the server running again because you were unlucky (as I was) and had no backups - I was able to get things working by doing a Registry Hive rec…
This tutorial will walk an individual through locating and launching the BEUtility application and how to execute it on the appropriate database. Log onto the server running the Backup Exec database. In a larger environment, this would generally be …
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

650 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question