Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Get client computer name

Status
Not open for further replies.

meldrape

Programmer
May 12, 2001
516
US
I've never tried to do this before, but I've been asked to get the client machine name for a help desk ticket app. I found this code but it returns the web server name. Can it be done client side? Any ideas would be appreciated. Thanks.
Code:
Set WshNetwork = server.CreateObject("WScript.Network") 
IntMachinName=WshNetwork.ComputerName
Response.write IntMachinName
 
don't believe it can be done, but don't quote me on that, cause as soon as i say that someone will bust out some code for you.....

www.sitesd.com
ASP WEB DEVELOPMENT
 
not me, i totally agree with snowboardr

Known is handfull, Unknown is worldfull
 
looks like someone else has that same issue as you:

thread333-888833


www.sitesd.com
ASP WEB DEVELOPMENT
 
Hello meldrape,

A client-side info closer to your wish can be retrieved like this.
Code:
<%
ipaddr=request.servervariables("REMOTE_ADDR")
response.write ipaddr & "<br>"
set odns=server.createobject("aspdns.dnslookup")
hostname=odns.getnamefromip(ipaddr)
response.write "client's host name : " & hostname & "<br>"
set odns=nothing
%>
with aspdns freeware of stefan:

regards - tsuji
 
looks promissing tsuji, however what component needs to be installed on the server?




www.sitesd.com
ASP WEB DEVELOPMENT
 
Hello snowboardr,

It should be installed (basically simple regsvr32 to registry) on the server. Yes.

regards - tsuji
 
Many thanks to all. The code tsuji provided returns the IP address but errors out on the rest. (set odns=server.createobject("aspdns.dnslookup")) I really need the computer name, but I guess the IP address will have to do. Many thanks again to everybody who participated. :)
 
meldrape,

You have to install the freeware component. If still error out, post back.

- tsuji
 
thats what i am asking.. what component?

www.sitesd.com
ASP WEB DEVELOPMENT
 
I believe he's talking about this one:

aspdns.dnslookup (asp dns)

I looked it up. It looks pretty slick on the surface but I haven't downloaded it yet.
 
I don't think its always going to work, because I think virus protection may block the look-up.


www.sitesd.com
ASP WEB DEVELOPMENT
 
AspDNS is available from serverobjects.com for a price, there's also a "free" ( donation freeware ) replica of it at
also you can write one fairly easily in VB6 and there's a few tutorials about the internet to do so.

you would need to download and install the component, after that you can call it via the server.createobject("aspdns.dnslookup")

if this is properly installed on the server, it should route via the server's DNS settings and/or any LMHosts data that resides on the server including internal dns. if this is for an tntranet you should have no issues.

due to this executing on the server and requesting dns information, not accessing the remote machine/client, you might need to allow the object internet access ( on the server itself ) should you happen to have a software firewall.

antivirus software should be of no consequence.

[thumbsup2]DreX
aKa - Robert
 
snowboardr,

"Always" is a very treasurable ideal. In the real, even at the level of server.variables("REMOTE_ADDR") thing will let you done.

- tsuji
 
Correction:
I meant request.servervariables("REMOTE_ADDR").
- tsuji
 
From what i heard tsuji, server variables requires you the server to get all server variables for just one... thats bad.

www.sitesd.com
ASP WEB DEVELOPMENT
 
Most machines will continually renew the same DHCP address, so why not create yourself a table that tracks the IP & machine name?

If you don't have access tot he DHCP server, you could use PING with the -a switch to return the machine name.

I hope you find this post helpful. Please let me know if it was.

Regards,

Mark
 
Hello DreXor and all,

The free component I have mentioned aspdns, though by name collides with some component offered by as you mentioned serverobjects.com at a price, is not the same. The link to the download is given in my first posting already. The documentation page is its parent folder:

Just don't want to give a wrong impression. Furthermore, stefan's site offer a heavier weight free component aspdnsx as you mentioned.

It goes no surprise that there are alternatived, free or not, with similar functionality. The technology is not classified after all.

regards - tsuji
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top