Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Enabling DHCP via Group Policy

Status
Not open for further replies.

superco7

Technical User
Dec 20, 2002
78
US
I am in the process of switching my network from using static IP addresses to DHCP. Is there a group policy setting to make this change company wide? I have used scripts in the past but many of the network connetion names are different, so I would have to make multiple scripts. Just looking for a way to avoid touching 130+ pcs/laptops. I am currently running Windows 2003 Active Directory. Any help would be greatly appreciated. Thanks in advance.
 
seems possible...

article said:
[June 5, 1999]
How can I perform a migration to DHCP?
John Savill
InstantDoc #14990
John Savill's FAQ for Windows
Get the recognition you deserve

Search over 70,000 tech jobs from top companies at Dice.com

A. A. There are only a few basic registry entries that define a client as a DHCP client so an easy way to migrate clients to DHCP is to create a registry script that sets the required values via logon script. You should obviously be careful that there is no overlap between the addresses in the DHCP address pool and those statically assigned.

The DHCP service needs to be configured to start at system startup.Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\DHCP\ and change the value entry Start from 1 to 2.

TCPIP parameters are defined to each NIC (Network Interface Card).

The following is an example registry script you may consider using. If you are unsure of the card service goto HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\NetworkCards\1 and write down the data for the value entry ServiceName

REGEDIT4

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\<card service>\Parameters\Tcpip]
"EnableDHCP"=dword:00000001
"IPInterfaceContext"=dword:00000001
"IPInterfaceContextMax"=dword:00000001

You should then add something into the logon script to detect the NIC installed into the computer, run the reg script and request an IP address, e.g.

if reg=elpc575 (for the 3com575tx) goto dhcp
..
..
..
:dhcp
regedit /s NIC_dhcp.reg
ipconfig /renew
net send %computername% Congrats Your computer has been configured for DHCP!
endif

A quick way to find out which network card you are using is on you LAN you will have various types of NIC.

For instance you may have the 3c89d, netflx3,3c575tx for instance for the Neflx3 driver, when the install takes place on the NT 4.0 it adds a registry key in the HKEY_LOCAL_MACHINE\systems\Current control set\system\services\cpqNF31 with the parameters:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CpqNF31\Parameters\Tcpip]
"EnableDHCP"=dword:00000000.

You have to find out what the key name is because it is different for each NIC then you can run kix32.exe and use the arguement:

EXISTKEY (
"Key"
)

Checks for the existence of a registry key.

Parameters
Key - Identifies the key you want to check the existence of.

Returns
0 the key specified exists (Note : this is different from the way the EXIST function works...)
>0 the key does not exist, returncode represents an errorcode

$ReturnCode=ExistKey(
"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\CpqNF31" )

If $ReturnCode=0
? "Key exists...."
Endif

...to detemine if the key exist and then execute accordingly for that specific card.

You may also set the value IPAddress=0.0.0.0 and value SubnetMask=0.0.0.0 for the card service however they will be ignored anyway. Fill in the IPAddress and SubnetMask with 0.0.0.0. Blanking out or deleting the values won't work. Restart the workstation to complete the change.

This can also be done using Windows Scripting Host

Aftertaf
We shall prevail, and they shall not
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top