Set DNS with powershell

From DevOps Notebook
Revision as of 16:45, 5 March 2020 by MilosZ (talk | contribs) (Created page with "===Set primary windows dns with powershell script=== <pre> $dnsserver = (,"1.1.1.1") Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE | Invoke-Wmi...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Set primary windows dns with powershell script

$dnsserver = (,"1.1.1.1")
Get-WmiObject -Class Win32_NetworkAdapterConfiguration -Filter IPEnabled=TRUE | Invoke-WmiMethod -Name SetDNSServerSearchOrder -ArgumentList (,$dnsserver)