computer_science:windows:powershell:powershell_scripts:change_remote_ip_and_dns_powershell_script

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
computer_science:windows:powershell:powershell_scripts:change_remote_ip_and_dns_powershell_script [2020/07/23 22:39] – external edit 127.0.0.1computer_science:windows:powershell:powershell_scripts:change_remote_ip_and_dns_powershell_script [2023/12/01 12:07] (current) – external edit 127.0.0.1
Line 1: Line 1:
-====== Change remote IP address and DNS entry with a PowerShell script ======+====== [Script] Change remote IP address and DNS entry with a PowerShell script ======
  
 |Original Source|[[https://4sysops.com/archives/change-remote-ip-address-and-dns-entry-with-a-powershell-script/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+4sysops+(4sysops)|4SysOp]]| |Original Source|[[https://4sysops.com/archives/change-remote-ip-address-and-dns-entry-with-a-powershell-script/?utm_source=feedburner&utm_medium=feed&utm_campaign=Feed:+4sysops+(4sysops)|4SysOp]]|
Line 148: Line 148:
     Write-Verbose  "The IP address provided is already set on the NIC `"$InterfaceAlias`" on computer $ComputerName. No change was made"     Write-Verbose  "The IP address provided is already set on the NIC `"$InterfaceAlias`" on computer $ComputerName. No change was made"
     }     }
 +
  
 </code> </code>
Line 154: Line 155:
  
   * First, a computer name. If none is provided, it will attempt to perform the changes on the local computer. The function is kind enough to mention this to you (if you selected Verbose mode).   * First, a computer name. If none is provided, it will attempt to perform the changes on the local computer. The function is kind enough to mention this to you (if you selected Verbose mode).
-  * Then, you will need to provide a new IP address. I'm quite proud of this function, but I'll be the first to admit it is not able to guess an IP address for you. I know, I know...+  * Then, you will need to provide a new IP address. I'm quite proud of this function, but I'll be the first to admit it is not able to guess an IP address for you. I know, I know
   * You can disable DHCP on the NIC by setting the parameter //DisableDhcp//. If you don't specify it, it will be disabled by default. Once again, the function is kind enough to inform you about this (still assuming you're running the function with the Verbose switch).   * You can disable DHCP on the NIC by setting the parameter //DisableDhcp//. If you don't specify it, it will be disabled by default. Once again, the function is kind enough to inform you about this (still assuming you're running the function with the Verbose switch).
   * You can also disable DNS registration for the NIC. Normally, you wouldn't be interested in doing that on a "public-facing" NIC, but if the network interface will be used for management or as part of a cluster-traffic-only subnet, you may want to skip this. You need to specify this with the value "Yes;" otherwise, DNS registration will not be disabled. Once again, the function is kind enough to inform you about this.   * You can also disable DNS registration for the NIC. Normally, you wouldn't be interested in doing that on a "public-facing" NIC, but if the network interface will be used for management or as part of a cluster-traffic-only subnet, you may want to skip this. You need to specify this with the value "Yes;" otherwise, DNS registration will not be disabled. Once again, the function is kind enough to inform you about this.
-  * A DNS server. This is where the function will attempt to connect and clean up the old IP address. If one is not provided, it will attempt to do this on the DC your computer is logged on to. Normally, the DCs are DNS servers, too. If they are not DNS servers in your environment, or you are not in an AD environment, well ... please do provide a DNS server. You're probably used to it by now, but ... yes, the function will inform you. Just make sure you've selected Verbose mode.+  * A DNS server. This is where the function will attempt to connect and clean up the old IP address. If one is not provided, it will attempt to do this on the DC your computer is logged on to. Normally, the DCs are DNS servers, too. If they are not DNS servers in your environment, or you are not in an AD environment, well … please do provide a DNS server. You're probably used to it by now, but … yes, the function will inform you. Just make sure you've selected Verbose mode.
  
 You can get more information by using //Get-Help Update-IPv4Address//. You can get more information by using //Get-Help Update-IPv4Address//.
Line 175: Line 176:
   * Disable DNS registration (if prompted to do so). Of course, if you omitted this or mentioned that you wanted DNS registration, this step will not be performed.   * Disable DNS registration (if prompted to do so). Of course, if you omitted this or mentioned that you wanted DNS registration, this step will not be performed.
   * Remove the old IP address(es) from the specified NIC on the target computer. If Verbose mode is selected, you will be informed about these old addresses, too.   * Remove the old IP address(es) from the specified NIC on the target computer. If Verbose mode is selected, you will be informed about these old addresses, too.
 +
 +\\
  
  
  • computer_science/windows/powershell/powershell_scripts/change_remote_ip_and_dns_powershell_script.1595543976.txt.gz
  • Last modified: 2023/12/01 12:07
  • (external edit)