You could always try the following script. I don't recommend running it more than once per session. You need samba installed on the web server to do this but nothing samba-wise needs to be running or mounted.
set win_info [exec nmblookup -A $some_ip];
set machine_name_ptr [string first {<03>} $win_info];
set machine_name [string trim [string range $win_info [expr [string last {>} $win_info $machine_name_ptr] + 1] [expr $machine_name_ptr - 1]]]
(I don't actually use this script so I don't know how well it works. I did test it a couple of times before posting it though.)