You could always use the system exec to run the command
IPCONFIG /ALL
Then parse the text for the Host Name
That would eliminate any Windows version poblems.
If you want more than just the computer name, you can use something like this.
But not such a good solution on Windows Server OS:
https://lavag.org/topic/19322-get-host-name-performance-issue/