Home All Groups Group Topic Archive Search About


Author
4 May 2007 11:33 AM
Ricard Escamilla
I have this script:

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")

Set colNetAdapters = objWMIService.ExecQuery _
    ("Select * from Win32_NetworkAdapterConfiguration where IPEnabled=TRUE")

For Each objNetAdapter In colNetAdapters
    errEnable = objNetAdapter.EnableDHCP()
Next

That enables DHCP for my computers to take Adress, Mask and Gateway. I want
that my computers take the DNS servers by DHCP too but i don't know how to do
it.
Can someone help me?

Author
4 May 2007 12:32 PM
CreateWindow
Hi,

Your DHCP server should supply the DNS IP's. The script is OK.

Check the DNS Settings for your DHCP service?

Hope that helps,
CreateWindow
http://justpageprobe.com
The FREE Web page utility you always wanted.
Keep your router connected.
Email your IP to where you need it.
Monitor your enterprise Web Servers.


Show quote
"Ricard Escamilla" <RicardEscami***@discussions.microsoft.com> wrote in
message news:26C1348E-A0EB-4582-AA2C-35B3BDABF4A4@microsoft.com...
>I have this script:
>
> strComputer = "."
> Set objWMIService = GetObject("winmgmts:" _
>    & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
>
> Set colNetAdapters = objWMIService.ExecQuery _
>    ("Select * from Win32_NetworkAdapterConfiguration where
> IPEnabled=TRUE")
>
> For Each objNetAdapter In colNetAdapters
>    errEnable = objNetAdapter.EnableDHCP()
> Next
>
> That enables DHCP for my computers to take Adress, Mask and Gateway. I
> want
> that my computers take the DNS servers by DHCP too but i don't know how to
> do
> it.
> Can someone help me?

AddThis Social Bookmark Button