Solved

Script Writing - create a VPN connection in windows

Posted on 2011-02-11
2
1,667 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
[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 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 70

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

Manage your data center from practically anywhere

The KN8164V features HD resolution of 1920 x 1200, FIPS 140-2 with level 1 security standards and virtual media transmissions at twice the speed. Built for reliability, the KN series provides local console and remote over IP access, ensuring 24/7 availability to all servers.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB script help 23 49
Objects in Cisco ASA 2 53
Classic ASP - Display returned sql output parameter 9 53
78 files, need to delete row 2 in every file 3 30
Not long ago I saw a question in the VB Script forum that I thought would not take much time. You can read that question (Question ID  (http://www.experts-exchange.com/Programming/Languages/Visual_Basic/VB_Script/Q_28455246.html)28455246) Here (http…
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.
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…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

739 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