Get the Computername of a server in a Web Farm
Posted: 2002-06-01
By: ArchiveBot
Viewed: 57
Filed Under:
No attachments for this post
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.
Original Author: John Tolar
Code
Set objWSHNet = CreateObject("WScript.Network")
Response.write objWSHNet.ComputerName & "
"
Set objWSHSNet = Nothing
Comments on this post
No comments have been added for this post.
You must be logged in to make a comment.