Let’s say you know the IP address of a computer but you don’t know the hostname. Seems to be an easy task with ping –a, if you have a working DNS
If not, you can try the following approach:
- Create a cmd on client’s computer. Say in \\IP\C$\Windows\Temp\FindHostname.cmd
- Edit FindHostname.cmd. Type in: echo %computername% >> C:\Windows\Temp\Hostname.log
- Run PSExec: C:\PSTools\PsExec.exe \\IP C:\Windows\Temp\FindHostname.cmd
- Look into \\IP\C$\Windows\Temp\Hostname.log, you will have the computer’s name.