0

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)

Dennis Williamson
  • 60,515
  • 14
  • 113
  • 148
TimothyP
  • 299
  • 1
  • 5
  • 15

3 Answers3

1

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.

Evan Anderson
  • 141,071
  • 19
  • 191
  • 328
1

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:

@echo off
rasdial "Name of GPRS connection" [username [password]]

The username and password 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 to Computer Settings -> Windows Settings -> Scripts (Startup/Shutdown) and double click on Startup.

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 hit OK. 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

start /min "" "C:\Windows\DialGPRS.cmd"

Batch file launched by the previous batch file:
C:\Windows\DialGPRS.cmd

@echo off
timeout 30
rasdial "Name of GPRS connection" [username [password]]

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.

Joshua
  • 1,546
  • 1
  • 13
  • 16
0

OK, here's a bit of a klugy solution so take it for what it's worth:

  1. Set the dial up connection to dial automatically.

  2. Set IE to use the dial up connection and to connect it automatically.

  3. Navigate to HKLM\Software\Microsoft\Windows\CurrentVersion\Run in the registry and add a new String Value

  4. 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.

joeqwerty
  • 108,377
  • 6
  • 80
  • 171