Change workstations to DHCP

  • Thread starter Thread starter Mike
  • Start date Start date
M

Mike

All workstations are static ip, XP sp2 on domain. DHCP server is Server2k3.

Is there an easy way to change all of my workstations from static to DHCP?
Group Policy? Logon script? Any good ideas?

Thanks,
Mike
 
Hi,

I usually use netsh for tasks like this... Here is a sample script (e.g.
startup script)...

netsh interface ip set address name="Local Area Connection" source=dhcp
netsh interface ip set dns name="Local Area Connection" source=dhcp

I hope it helps,
 
assign a computer startup script via gpo using the following vbs script:

Option Explicit
On Error Resume Next

Dim strComputer
Dim oWMIService
Dim colNetAdapters
Dim oNetAdapter
Dim errEnable
Dim arrDNSServers

strComputer = "."
Set oWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colNetAdapters = oWMIService.ExecQuery _
("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")
For Each oNetAdapter In colNetAdapters
errEnable = oNetAdapter.EnableDHCP()
arrDNSServers = Array()
oNetAdapter.SetDNSServerSearchOrder(arrDNSServers)
Next
 
Why do things manually when you can do them automatically. I really don't
feel like logging onto 500 machines and changing to "Obtain an address
automatically" under advanced tab of TCP\IP?
 
Back
Top