≡ Menu

Force dns registration on remote computers using PowerShell

In this article, let us see force local or remote computer to register its IP address in DNS using PowerShell. The native way of doing it is ipconfig /registerdns. The disadvantage with this is it cannot be used for triggering dns registration on remote computers.

There is a cmdlet called Register-DNSClient in DNSClient module which comes by default with Windows Server 2012/Windows 8 or above operation systems. The good thing with this cmdlet is it can be used for forcing remote clients to register dns.

First let us see how to force the local computer to register its DNS records.

Register-DnsClient            

Running above cmdlet from a PowerShell prompt will initiate the registration process.

If you want to perform similar operation against a remote computer, then you can use CimSession to trigger this.

$Computername = "TIBDC01"            
([WMIClass]"\\$ComputerName\ROOT\CImv2:Win32_Process").Create("cmd.exe /c ipconfig /registerdns")

This procedure works for Windows Server 2012/Windows 8 or later operating system. However if your remote computer is lower version than aforementioned versions, then you can use Get-WMIObject cmdlet to trigger this remotely.

This WMI approach works for any of the windows operating systems.

$session = New-CimSession -ComputerName TIBDC01            
Register-DnsClient -CimSession $session            

This way you can force the registration of DNS on any remote windows computer using PowerShell.

{ 0 comments… add one }

Leave a Comment