How can I determine the client computer name?

I’d like to customize a couple of methods based upon which station (we share workstations, so user won’t work) the application is running from via the Smart Client (web client would be awesome too). An example would be an error notification sent to IT identifying which client computer the problem took place on so that we can go to that station and research with the user. Can anyone point me in the right direction?

For Smart client, application.getIPAddress() will give you the IP of the workstation then you can perform an nslookup on that IP:

var ip = application.getIPAddress();
var result = application.executeProgram(‘nslookup’,ip);
application.output(result);

Thanks Patrick,

Unfortunately, that doesn’t work on my computer. Truthfully, I’ve had little success with nslookup in my entire career. This is the response from the application.executeProgram(‘nslookup’,ip); command: “Server: UnKnown\nAddress: 10.11.0.76\n\n”

Are there any other options available?

Don’t know, sorry. Check with your router/dns to see how it’s configured it should return something more significant than that.

Try the free tools plugin of IT2BE, there you can get the real computername

Thank you Harjo. Quick and painless.

You can also simply do:

application.executeProgram('hostname')

Should work for windows, mac and unix/linux. But will get you server hostname in webclient.

The nslookup “Server: Unknown” may or may not be a problem. Nslookup first tries to resolve the ip address of the dns server setup on your interface card. The response you got is telling you a reverse zone was not located for the dns server address - so nslookup couldn’t get the name of the dns server. That will be an issue if you are in a corporate network with a domain controller or similar; but if this is a smaller office/home setup, not that uncommon. Just means you probably don’t have a local dns server setup (if you do, then it is not setup fully).