Get the Computername of a server in a Web Farm

Submitted on: 1/6/2015 10:37:00 AM
By: John Tolar (from psc cd)  
Level: Advanced
User Rating: By 5 Users
Compatibility: ASP (Active Server Pages)
Views: 2664
     We recently run into a problem working with a web farm and replication. We where getting a error that the tech people were say it was code and us the code people was saying it was Server related. Well, First we know it only happens 3 out of 10, So it must be happening only on one or two servers. If it was code It would happen on all servers, right??? Well, Lets find out which servers get the error, but how? ServerVariables only returns BROWSER header information and we need machine specific data. A Clustered farm generally uses the same IP info on a load balancer. so how do we get machine specific data. Well, use WSH of course. Three Lines. Hope you enjoy it. This will not work on XP, because the disabled WSH by default. you can turn it on though. check MS Knowledge bases for instructions.

				Set objWSHNet = CreateObject("WScript.Network")
Response.write objWSHNet.ComputerName & "
" Set objWSHSNet = Nothing

Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this article (in the Advanced category)?
(The article with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)

Other User Comments

 There are no comments on this submission.

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular article, please click here instead.)

To post feedback, first please login.