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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

converting network to dynamic IP from static 1

Status
Not open for further replies.

gamerboy

MIS
Jan 17, 2006
19
0
0
US
my company is planning on converting from static IP address on all the systems (both servers and desktops) to dynamic.

other than going around to each individual machine, is there a way, thru login scripts perhaps, to convert them all over to dynamic relatively quickly and smoothly.

we have about 400 machines, of which 380 are windows based and 95% are XP, the other 5% being 2000.
all of our servers run either server 2003 or server 2000.


thanks
 
Is there any particular reasononing for it?

400 machines on a static scheme must have been a nightmare to implement, but since it's now done...why change?

I've just had a quick look in group policy and cant see a control to enable DHCP.

Also, you shouldn't run a server on a dynamic address, it could cause a whole host of problems, DNS, Default Gateway, Application servers, web servers if applicable, etc etc etc...leave the servers static.

Unless there is a real case for switching to a dynamic scheme, I would suggest you didn't bother, as it could prove to be a nightmare of a task for no real gains.

'When all else fails.......read the manual'
 
we have been on static since the network was set up years ago, but to keep track of all those IPs and make sure there arent any given out twice is hell. plus a bunch of other reasons.


 
Fair point about keeping track of IPs - although it's not too hard if you just have a computer file with the allocated IP's listed.

It WILL be a pain changing to a DHCP scheme in the short term however long term you may have some administration benefits but nothing thats going to save heaps of time - however, it will remove the hastle of tracking Static IP assignments. Just make sure you note server IPs.

Make sure that your servers are NOT configured for DHCP and ensure that the addresses that they are assigned are not part of the DHCP address pool.

Perhaps this will be of use - copy the code into notepad and save it with a .vbs extension. Test it first obviously, then if it's OK add it as a startup script for your users, via group policy:

Code:
'All variables declared
Option Explicit

Dim oWSHShell
Dim sNIC, sMan
Dim iCount

Set oWSHShell = WScript.CreateObject("WScript.Shell")

' Set the DCHP service to autostart
oWSHShell.RegWrite "HKLM\SYSTEM\CurrentControlSet\Services\DHCP\Start", 2

' Get Network card
On Error Resume Next
iCount = 1
Do 
sNIC = oWSHShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\ " & _
"CurrentVersion\NetworkCards\" & iCount & "\ServiceName")
sMan = oWSHShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\ " & _
"CurrentVersion\NetworkCards\" & iCount & "\Manufacturer")
' Skip the Async and NDIS services
If sMan <> "Microsoft" And Err.Number = 0 Then
Call SetNIC
End If
iCount = iCount + 1
Loop Until Err.Number <> 0

' Clear the error
Err.Clear

' End of Script



Sub SetNIC
Dim iTest
' Set the NIC service to use DHCP
sNIC = "HKLM\SYSTEM\CurrentControlSet\Services\" & sNIC &"\Parameters\TCPIP\"
iTest = oWSHShell.RegRead(sNIC & "EnableDHCP")
If iTest = 0 Then
oWSHShell.RegWrite sNIC & "EnableDHCP", 1, "REG_DWORD"
oWSHShell.RegWrite sNIC & "IPAddress", "0.0.0.0", "REG_MULTI_SZ"
oWSHShell.RegWrite sNIC & "SubnetMask", "0.0.0.0", "REG_MULTI_SZ"
End If
End Sub

taken from:
Good luck, hope this helps.


'When all else fails.......read the manual'
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top