Displaying computername in a browser?

I have an intranet start page that everyone in the company jumps into whenever they login
Currently, it displays via Javascript the time/date and the IP of the PC.

I was hoping to find a way to also display the computername right below the IP.
I plan on doing a full scale inventory of my PCs and having this available will help me alot as I can have some people self-inventory their PCs by email.

My IP one looks like this:

<font size="1" face="Arial">IP - <!--#include virtual="/bin/ipaddr.pl"--> </font></center>  

I was hoping for something just as easy
Who is Participating?
You have to use client side scripting (ASP,PHP,etc...) to retrieve the computer name.


Set WshNetwork = server.CreateObject("WScript.Network")
Response.write IntMachinName
jskewesAuthor Commented:
is that just something I can add to an SHTML page?
Introducing Cloud Class® training courses

Tech changes fast. You can learn faster. That’s why we’re bringing professional training courses to Experts Exchange. With a subscription, you can access all the Cloud Class® courses to expand your education, prep for certifications, and get top-notch instructions.

If you are running IIS then just save that code in a page called something like compName.asp.

Then include that file in your .shtml.  I think it should work.

Otherwise, you may have to change your IIS settings to see .shtml files as .asp files.
I know of some free open source software to do Software and Hardware inventory remotley logged into an admin account. We use it here and it works great, all you do is execute the script and it will query your network for all the machines and give the system specs, Windows version, software installed, hardware, gives you lots of other options too. Let me know if this software would interest you and I will post it.

jskewesAuthor Commented:
I don't think I have IIS running on my intranet webpage server.
I'd rather use some sort of javascript.pl
oops!  I meant <b>server</b> side (ASP, PHP, etc...)
You should post the contents of the /bin/ipaddr.pl  since it is a script that is running on the server.

If your hosts names are in dns, you could add a line to the script to do a reverse nslookup on the ip addresses which would supply the hostname.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.