Link to home
Start Free TrialLog in
Avatar of Kelly Garcia
Kelly GarciaFlag for United Kingdom of Great Britain and Northern Ireland

asked on

wmi set dns server powershell

Hi Guys,

I have this code to define the dns server:

$wmi = Get-WmiObject win32_networkadapterconfiguration -filter "ipenabled = 'true'"

$wmi.EnableStatic("10.0.0.15", "255.255.255.0")

$wmi.SetGateways("10.0.0.1", 1)

$wmi.SetDNSServerSearchOrder("10.0.0.100")


However I also need to specify the alternative dns server ideally using powershell,l how can I do this?

thank you in advance.
Avatar of SteveGTR
SteveGTR
Flag of United States of America image

Can you say:

$wmi.SetDNSServerSearchOrder("10.0.0.100", "10.0.0.101")
ASKER CERTIFIED SOLUTION
Avatar of Raheman M. Abdul
Raheman M. Abdul
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial