Here's the proper way to do this.
http://msdn.microsoft.com/en-us/library/aa370663%28v=vs.85%29.aspx[
^]
This says it will work in Server 2000 and above; but we all know, now, how much we can really trust Microsoft.
IntPtr buffer;
var ret = PInvoke.NetWkstaGetInfo(host, 100, out buffer);
var strut_size = Marshal.SizeOf(typeof (WKSTA_INFO_100));
WKSTA_INFO_100 wksta_info;
if (PInvoke.ERROR_SUCCESS == ret)
{
wksta_info = (WKSTA_INFO_100) Marshal.PtrToStructure(buffer, typeof (WKSTA_INFO_100));
if (!string.IsNullOrEmpty(wksta_info.computer_name))
return wksta_info.computer_name;
}