• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1346
  • Last Modified:

Rollout VPN setting to multiple machines

I have many users that work from home. They connect by Microsoft VPN.

I am changing the VPN IP Address, and I want to automate the change to the home users. (The users have very basic skills, and anything partially difficult will cause probelms)

Is there a file/s and registry settings that can be exported from a master machine, so that I can give the users a batch file to run that creates the VPN properties on their home machines.

Jim
0
jsulliva1957
Asked:
jsulliva1957
  • 2
  • 2
1 Solution
 
CorpCompCommented:
I had a similar situation recently.  I used a batch file to append a new connection to the rasphone.pbk (phonebook).  Attached is my code.

This code appends text found in the raphone.txt file in the same directory.  This is the text that I used in my rasphone.txt:

[Connection Name]
Encoding=1
Type=2
AutoLogon=0
UseRasCredentials=1
LowDateTime=2070362960
HighDateTime=29895615
DialParamsUID=179686328
Guid=BAA607C0E61E6D4A9CC6758C3D766DA6
BaseProtocol=1
VpnStrategy=2
ExcludedProtocols=10
LcpExtensions=1
DataEncryption=256
SwCompression=0
NegotiateMultilinkAlways=0
SkipNwcWarning=0
SkipDownLevelDialog=0
SkipDoubleDialDialog=0
DialMode=1
OverridePref=15
RedialAttempts=3
RedialSeconds=60
IdleDisconnectSeconds=0
RedialOnLinkFailure=1
CallbackMode=0
CustomDialDll=
CustomDialFunc=
CustomRasDialDll=
ForceSecureCompartment=0
DisableIKENameEkuCheck=0
AuthenticateServer=0
ShareMsFilePrint=1
BindMsNetClient=1
SharedPhoneNumbers=0
GlobalDeviceSettings=0
PrerequisiteEntry=
PrerequisitePbk=
PreferredPort=VPN5-0
PreferredDevice=WAN Miniport (L2TP)
PreferredBps=0
PreferredHwFlow=1
PreferredProtocol=1
PreferredCompression=1
PreferredSpeaker=1
PreferredMdmProtocol=0
PreviewUserPw=1
PreviewDomain=0
PreviewPhoneNumber=0
ShowDialingProgress=1
ShowMonitorIconInTaskBar=1
CustomAuthKey=-1
AuthRestrictions=512
TypicalAuth=2
IpPrioritizeRemote=1
IpInterfaceMetric=0
fCachedDnsSuffix=0
IpHeaderCompression=0
IpAddress=0.0.0.0
IpDnsAddress=[enter DNS server here]
IpDns2Address=0.0.0.0
IpWinsAddress=0.0.0.0
IpWins2Address=0.0.0.0
IpAssign=1
IpNameAssign=2
IpDnsFlags=0
IpNBTFlags=1
TcpWindowSize=0
UseFlags=0
IpSecFlags=0
IpDnsSuffix=
IpCachedDnsSuffix=
Ipv6PrioritizeRemote=1
Ipv6InterfaceMetric=0
Ipv6NameAssign=1
Ipv6DnsAddress=::
Ipv6Dns2Address=::
Ipv6InterfaceId=0000000000000000

NETCOMPONENTS=
ms_server=1
ms_msclient=1
ms_pacer=1
cntx_vpcnets2=1

MEDIA=rastapi
Port=VPN0-0
Device=WAN Miniport (L2TP)

DEVICE=vpn
PhoneNumber=[enter IP address here]
AreaCode=
CountryCode=61
CountryID=61
UseDialingRules=0
Comment=
LastSelectedPhone=0
PromoteAlternates=0
TryNextAlternateOnFail=1


@echo off
IF EXIST C:\VPN.txt goto answer0
IF EXIST "C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk" goto answer1
IF NOT EXIST "C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk" goto answer2
 
:answer0
REM VPN.txt exists
pause
exit
 
:answer1
REM VPN.txt does not exist but .pbk does exist
RENAME "C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk" rasphone.pbk.backup
REM ECHO >>"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
TYPE "C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk.backup" >>"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
TYPE rasphone.txt >>"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
ECHO PBK renamed to .pbk.backup and new .pbk created >>C:\VPN.txt
date /t >>C:\VPN.txt
time /t >>C:\VPN.txt
pause
exit
 
:answer2
REM ECHO >>"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
TYPE rasphone.txt >>"C:\Documents and Settings\All Users\Application Data\Microsoft\Network\Connections\Pbk\rasphone.pbk"
ECHO PBK did not exist, new .pbk created >>C:\VPN.txt
date /t >>C:\VPN.txt
time /t >>C:\VPN.txt
pause
exit

Open in new window

0
 
jsulliva1957Author Commented:
Hi Moto Crazy
0
 
jsulliva1957Author Commented:
ooops
I have been away from my computer for a day or so. MotoCrazy, the CMAK work beautifully.

Cheers

Jim
0
 
MotoCrazyCommented:
Awesome. Glad you got it.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now