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:
</script><br>

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

I was hoping for something just as easy
jskewesAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

rockymageeCommented:
In ASP:

<%
Set WshNetwork = server.CreateObject("WScript.Network")
IntMachinName=WshNetwork.ComputerName
Response.write IntMachinName
%>
jskewesAuthor Commented:
is that just something I can add to an SHTML page?
rockymageeCommented:
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.
Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

JoeWeb Application DeveloperCommented:
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.

Joe
jskewesAuthor Commented:
I don't think I have IIS running on my intranet webpage server.
I'd rather use some sort of javascript.pl
rockymageeCommented:
You have to use client side scripting (ASP,PHP,etc...) to retrieve the computer name.

http://www.experts-exchange.com/Web/Web_Languages/JavaScript/Q_20580517.html?query=get+computer+name&topics=87

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rockymageeCommented:
oops!  I meant <b>server</b> side (ASP, PHP, etc...)
arthurjbCommented:
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.

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Development

From novice to tech pro — start learning today.