Solved

Script Writing - create a VPN connection in windows

Posted on 2011-02-11
2
1,578 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 68

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

Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Active Directory replication delay is the cause to many problems.  Here is a super easy script to force Active Directory replication to all sites with by using an elevated PowerShell command prompt, and a tool to verify your changes.
If you use NetMotion Mobility on your PC and plan to upgrade to Windows 10, it may not work unless you take these steps.
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…
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…

747 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now