Microsoft has already published an article to change Static IP address of client computers to DHCP (make DHCP Enable) over the network.
The following article can be used to change all static clients to DHCP-aware
.
In deed, the above article is useful but it requires a lot of manual effort. You need to connect every computer through "Remote Registry API" and then change the required detail in registry for all computers.
This is lengthy task when you need to do the manual work on more than 100 computers. I have pointed out a solution for this situation.
Please follow the steps outlined here:
- You need have the following tools handy before you can accomplish this:
WininstLE
PSEXEC
- Using WININSTLE you need to find out the registry keys for DHCP Client machine when they obtain IP Address automatically from DHCP Server.
- Using PSEXEC (if your network is in Workgroup Security Model) or Group Policy (If you are in Domain Security Model) to deploy DHCP Client settings remotely with a text file pre-configured which can be used to differentiate between IP addresses used by client machines.
- You need to install and run WinInstLE on one of your client computer.
- Go to a client machine.
- Install WININSTLE. This utility is located at Windows 2000 CD.
- Run WININSTLE. Perform *Before Snapshot* operation.
- Give a path to save MSI file and registry informations.
- Restart client computer.
- Configure client machine to obtain IP address automatically from DHCP Server.
- After restarting client computer, run *After Snapshot*. This will record any changes made during the operation DHCP Client contacted and received IP Address information from DHCP Server.
- Edit the *.REG file and delete the IP Address DHCP Client received from DHCP Server. This will make sure that all the client computers use unique IP Address on network. Save this file.
- Now you have two files to deploy either using PSEXEC or Group Policy.
- MSI file
- REG file
- You can deploy MSI file (that is the configuration of DHCP Client) using Group Policy Software Installation snap-in. OR
- You can deploy MSI file or REG file using PSEXEC remotely on all client computers.
By using PSEXEC you can specify a text file which keeps information about the IP Address and Client computer name.
Now you need to put everything together to get things working. This is how you do it:
Note: The only unique filed required in DHCP Configuration is IP Address. - You have got a REG file with you from WININSTLE. Edit this REG file and remove the IP Address value. I think you have already done in above steps.
- Save this REG file.
- Copy the full MSI folder to server from where you want to deploy DHCP settings.
- Deploy MSI file using Software Installation snap-in.
- After deploying MSI file all configuration settings will be saved in all client computers except IP Address.
- Next client computers will restart they will obtain IP Address from DHCP Server.
Note: If you want to enable DHCP for other connection specify the name of connection in netsh command.
netsh interface ip set address "Local Area Connection" dhcp This should work well.
SUMMARY: - The following is required for client to be a DHCP Client when configuring manually:
DHCP Client service should be started.
Client LAN connection should be set to *Obtain IP from DHCP Server*.
netsh interface ip set address "Local Area Connection" dhcp
DHCP Client must have a unique IP Address on network.
Some registry entries as described in the above article must be set.
HKLM\SYSTEM\CurrentControlSet\Services\XXXXXX\Parameters\TCPIP, where XXXXXX is the value of ServiceName found in the step 3 in the above article.
EnableDHCP = 1
IPAddress = 0.0.0.0
SubnetMask = 0.0.0.0
DHCPDefaultGateway = 192.168.0.1 -- If you are using some other gateway then you need to put it in script or manually in registry.
DHCPIPAddress = 192.168.0.5 --- IP got from DHCP server.
DHCPServer = 192.168.0.1 -- IP Address of DHCP server.
You don not need to restart workstation. Simply restart
DHCP Client service on destination computer using a script.