What's that computer's real name?

In a Windows DHCP environment you can end up with stale records, particularly if scavenging has been turned off or misconfigured.  The result is an incorrect name returned to an nslookup or "ping -a" command.  Then the question becomes one of what is the real name of that computer on the other end?  If you can reach the computer over the net and you have administrative privileges, WMI is happy to tell you who's at the other end.

Options:

  • This script uses multiple string inputs on the first line.  You could make it a single line script by elimiating the first line and entering the IP address for the -ComputerName parameter.
  • Of course there is the (get-content servers.txt) trick used in many of the scripts here.
Anonymous