Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

PowerShell Set DNS Settings

Posted on September 24, 2015October 16, 2015 By David Kittell

This only works on Windows 8, 8.1, 10 as the Cmdlets Set-DnsClientServerAddress Get-DnsClientServerAddress are introduced in Windows 8.

First get the interface name(s) you want to modify

Get-DnsClientServerAddress

Change the code below to the interface you wish to change

$primarydns = $args[0]
$secondarydns = $args[1]

Set-DNSClientServerAddress –interfaceAlias Wi-Fi –ServerAddresses ($primarydns,$secondarydns)
Get-DnsClientServerAddress -InterfaceAlias Wi-Fi
.\UpdateDNS.ps1 8.8.8.8 8.8.4.4   
Originally Posted on September 24, 2015
Last Updated on October 16, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.

Related

Code PowerShell

Post navigation

Previous post
Next post

Related Posts

Windows Phone 8/8.1 – My Location

Posted on April 6, 2015

If you have Windows Phone and would like to be able easily send your location to someone the code below will be helpful. When reviewing the code you will find that it is functional but lacks a pleasant user interface, as you build this app you can add your own…

Read More

Get Folder Size

Posted on December 14, 2013October 26, 2015

Function GetFolderSize(ByVal DirPath As String, _ Optional ByVal IncludeSubFolders As Boolean = True) As Long Dim lngDirSize As Long Dim objFileInfo As FileInfo Dim objDir As DirectoryInfo = New DirectoryInfo(DirPath) Dim objSubFolder As DirectoryInfo Try ‘add length of each file For Each objFileInfo In objDir.GetFiles() lngDirSize += objFileInfo.Length Next ‘call…

Read More

Install SQL PowerShell Tools

Posted on October 14, 2015October 14, 2015

To install the 2014 PowerShell tools, the script below will help make it a bit easier. First all downloads are referenced from this URL (specific for SQL 2014) http://www.microsoft.com/en-ca/download/details.aspx?id=42295 I use Windows 64-Bit so if you use 32-Bit make sure you update your links # Microsoft® Windows PowerShell Extensions for…

Read More

Code

Top Posts & Pages

  • Bleaching Wool using Hydrogen Peroxide
  • Front Page
  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • Bleaching Wool using Hydrogen Peroxide
  • PowerShell - Rename Pictures to Image Taken
  • Open On Screen Keyboard (OSK)
  • SQLite - Auto-Increment / Auto Generate GUID
  • PowerShell - IPv4 Range
  • PowerShell - Install .NET 4.5.2
©2025 David Kittell | WordPress Theme by SuperbThemes
 

Loading Comments...
 

You must be logged in to post a comment.