Change workstations to DHCP

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
 
M

Miha Pihler [MVP]

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,
 
N

Nathan

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
 
M

Mike

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?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top