#Input file is CSV file with headers IPaddress
$Computers = import-csv “c:\temp\servers.csv”
ForEach ($Computer in $Computers) {
Write-Host “$($Computer.IPAddress): ” -ForegroundColor Yellow
Invoke-Command -ComputerName $Computer.IPAddress -ScriptBlock {
#input Cirrect DNS IP’S in the feals
$NewDnsServerSearchOrder = “10.10.1.200”,”10.10.1.106″
$Adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.DHCPEnabled -ne ‘True’ -and $_.DNSServerSearchOrder -ne $null}
# Show DNS servers before update
Write-Host "Before: " -ForegroundColor Green
$Adapters | ForEach-Object {$_.DNSServerSearchOrder}
# Update DNS servers
$Adapters | ForEach-Object {$_.SetDNSServerSearchOrder($NewDnsServerSearchOrder)} | Out-Null
# Show DNS servers after update
$Adapters = Get-WmiObject Win32_NetworkAdapterConfiguration | Where-Object {$_.DHCPEnabled -ne 'True' -and $_.DNSServerSearchOrder -ne $null}
Write-Host "After: " -ForegroundColor Green
$Adapters | ForEach-Object {$_.DNSServerSearchOrder}
}
}
fxzy7g
nrifit
jwsiit
gr6x6p
nj2q0o
fnc92l
I couldn’t resist commenting
What i don’t understood is in fact how you are not really a lot more neatly-appreciated than you may be now. You’re so intelligent. You realize therefore considerably in terms of this subject, made me personally believe it from numerous various angles. Its like women and men aren’t fascinated unless it is one thing to accomplish with Lady gaga! Your personal stuffs great. At all times take care of it up!
I like what you guys are up also. Such clever work and reporting! Carry on the excellent works guys I¦ve incorporated you guys to my blogroll. I think it will improve the value of my website 🙂
jw6lh1
evkx2f
Well I definitely liked reading it. This subject offered by you is very helpful for proper planning.
novie7
tq1wlt
Hiya, I’m really glad I have found this information. Today bloggers publish just about gossips and internet and this is really irritating. A good website with interesting content, that’s what I need. Thanks for keeping this web site, I’ll be visiting it. Do you do newsletters? Can not find it.
xrd3kg
2yyt9x
Well I truly liked studying it. This article procured by you is very practical for good planning.
When I initially commented I clicked the “Notify me when new comments are added” checkbox and now each time a comment is added I get four e-mails with the same comment. Is there any way you can remove people from that service? Cheers!
dxpi13
14ck19