Solved

Script Writing - create a VPN connection in windows

Posted on 2011-02-11
2
1,617 Views
Last Modified: 2012-05-11
Not sure if this is possible, or if parts are possible, but I want to deploy a VPN connection to my end users, some XP some 7.  i want to make thsi as easy as possible for them.  Here's the things I'd love to be able to do:
1. Have a script that creates a VPN connection to a specified address and then dumps a shortcut on their desktop
2. If possible have the script change the icon from the normal VPN icon to the RDP icon
3. If possible, force the VPN client to launch RDP

I'm not sure if any of this is possible, but if it is, that would be awesome!
0
Comment
Question by:JamesonJendreas
2 Comments
 
LVL 22

Accepted Solution

by:
Jody Lemoine earned 250 total points
ID: 34891051
Have a look at the Microsoft Connection Manager Administration Kit (CMAK) for this sort of thing.

http://technet.microsoft.com/en-us/library/dd672646(WS.10).aspx

It allows you to easily create custom VPN profiles with scripted components and the like.  I don't know if it will necessarily do *everything* you're looking for, but it should cover most of it.
0
 
LVL 69

Assisted Solution

by:Qlemo
Qlemo earned 250 total points
ID: 34892564
You can script the VPN itself instead of installing anything. What you need is a general .pbk file (Phonebook) describing the type of connection (e.g. PPTP) with a general or specific connection name (I use msvpn for that). You can create that on any PC, and just copy it as your template.

Connecting will then be consist of a batch file:
@echo off
rasdial «msvpn» «User» «Password» /domain:«Domain» /phone:«IP-Address» /phonebook:«Path and Name of the PBK file»
start /wait mstsc /v:«IP-Address to RDP to»
rasdial /D «msvpn»

Open in new window

All parts in «» are to be replaced by your own choice. That code should start VPN, kick on RDP, and as soon as RDP terminates close the VPN connection.
0

Featured Post

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Secure VPN Connection terminated locally by the Client.  Reason 442: Failed to enable Virtual Adapter. If you receive this error on Windows 8 or Windows 8.1 while trying to connect with the Cisco VPN Client then the solution is a simple registry f…
OpenVPN is a great open source VPN server that is capable of providing quick and easy VPN access to your network on the cheap.  By default the software is configured to allow open access to your network.  But what if you want to restrict users to on…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…

805 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