IT Questions and Answers :)

Tuesday, September 29, 2020

What PowerShell Cmdlet would you use to update the Primary and Secondary DNS Server IP Addresses

What PowerShell Cmdlet would you use to update the Primary and Secondary DNS Server IP Addresses

  • Set-DNSServerAddress
  • Set-DNSClientServerAddress
  • New-DNSServerAddress
  • Set-DNSServerClientAddress 

 

What PowerShell Cmdlet would you use to update the Primary and Secondary DNS Server IP Addresses

EXPLANATION

This Cmdlet can also update the DNS Server IP Addresses on remove computers by creating a New-CimSession, then using the -CIMSession parameter

# These Commands will Update the NIC Interface called Ethernet




$Session = New-CimSession -ComputerName ComputerName
Set-DNSClientServerAddress -CimSession $Session -ServerAddresses 192.168.1.1,192.168.1.2 -InterfaceAlias *Ether*

You can list multiple IP's seperated by a comma, as well as multiple InterfaceAliases such as *ether*,*local*

SOURCE

https://blogs.technet.microsoft.com/heyscriptingguy/2014/08/30/powertip-use-powershell-to-set-primary-and-secondary-dns-server-addresses/



 

Share:

0 comments:

Post a Comment

Popular Posts