Oftentimes I receive an alert about a server, but the only information I have to work with is an IP address. Luckily, with the help of PowerShell and Active Directory, I was able to write a script to pull the computer name and some information on what that computer does.
The script is short, but a bit complicated. The first variable acquires the computer name via the IP address. That alone is enough if you have few servers, but with the number I deal with, oftentimes I need a bit more information.
The second part of the script splits the hostname up, removing any extra information and leaving just the computer name. Afterwards that value is piped to Get-AdComputer and then formatted as an easy to read table with minimal information. It returns what Organizational Units the computer is in, which should tell you what purpose your mystery IP serves. If you are lucky enough to have a description listed in AD, it will return that as well.
$IP = "192.168.0.0" $HostName = ([System.Net.DNS]::GetHostByAddress($IP)).HostName $Hostname.Split('.') | Get-AdComputer | FT Name,Description,DistinguishedName -AutoSize