Solved

wmi set dns server powershell

Posted on 2014-04-16
2
603 Views
Last Modified: 2014-04-28
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.
0
Comment
Question by:Kay
2 Comments
 
LVL 30

Expert Comment

by:SteveGTR
Comment Utility
Can you say:

$wmi.SetDNSServerSearchOrder("10.0.0.100", "10.0.0.101")
0
 
LVL 18

Accepted Solution

by:
Raheman M. Abdul earned 500 total points
Comment Utility
Try this: (if steveGTR given solution does not work)

$wmi.SetDNSServerSearchOrder(@("10.0.0.100", "10.0.0.101") )
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

New Windows 7 Installations take days for Windows-Updates to show up and install. This can easily be fixed. I have finally decided to write an article because this seems to get asked several times a day lately. This Article and the Links apply to…
The recent Microsoft changes on update philosophy for Windows pre-10 and their impact on existing WSUS implementations.
This tutorial will walk an individual through the steps necessary to enable the VMware\Hyper-V licensed feature of Backup Exec 2012. In addition, how to add a VMware server and configure a backup job. The first step is to acquire the necessary licen…
This tutorial will show how to configure a single USB drive with a separate folder for each day of the week. This will allow each of the backups to be kept separate preventing the previous day’s backup from being overwritten. The USB drive must be s…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now