We have a server that needs both a LAN and GPRS connection. We have configured the dial up connection in Windows but we need it to start whenever the server starts without user interaction and without a user logging on. Much like a service.
How can we do this?
It's a Windows 2008 Web Server Edition (R2)
Have a look at demand-dial interfaces in Routing and Remote Access Service. You can configure a connection as persistent and that should get you the behaviour you're looking for.
You may be able to do the following, but I do not have a test system to work with at this time.
Create a batch file with the following command:
The
username
andpassword
fields are optional and are only required if you didn't save the credentials for everyone when creating the connection. Of course, anyone with permissions could read the username and password from that file which may or may not be a problem.Save the batch file somewhere you'll remember (like C:\Windows or C:\Scripts or something), run
gpedit.msc
, navigate toComputer Settings
->Windows Settings
->Scripts (Startup/Shutdown)
and double click onStartup
.Once the
Startup Properties
dialog box loads, add a new script that points to the batch file created above (ex:C:\Windows\DialGPRS.cmd
). and hitOK
. On the next system reboot the computer will automatically run any scripts listed in the local group policy editor.Since I am unable to test this, it may run the command and fail to dial the connection before the network or computer is ready to actually handle the connection. If that is the case you'll need to use two batch files instead. The two batch files allows us to get around a script timeout that could cause Windows to terminate our batch script if it took too long.
Batch file launched by the computer startup script:
C:\Windows\StartGPRSConnection.cmd
Batch file launched by the previous batch file:
C:\Windows\DialGPRS.cmd
The first batch file is called by Windows during system startup. It launches the actual dial script as a different process and exits immediately so that your computer isn't waiting at the
Running Computer Startup Scripts
phase of startup. The timeout command (available in Server 2003/Vista/+ and higher only, not available in XP) takes the number of seconds you want to wait as its argument. In the example above it will wait for 30 seconds before attempting to dial the connection. Obviously this can be increased or decreased as necessary.OK, here's a bit of a klugy solution so take it for what it's worth:
Set the dial up connection to dial automatically.
Set IE to use the dial up connection and to connect it automatically.
Navigate to HKLM\Software\Microsoft\Windows\CurrentVersion\Run in the registry and add a new String Value
Call the String Value whatever you like and add this as the data: ieplore.exe "ip address of server" (without the quotes).
This will cause IE to launch to the default web site on the server and dial the GPRS connection automatically whenever the server is rebooted.
Alternately you can set IE to launch to any web site you want, but it's probably safer to launch it to a web site on the server itself. The important thing is making IE launch and dial the GPRS connection automatically.