473,396 Members | 2,085 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Caputuring (netbios) Server Name in ASP.NET

Using ASP.NET (or classic ASP) is there a way to capture the NETBIOS name of
the server that a page was run on?

Currently we have email based error reports which get sent to us from our
web sites. We have hundreds of websites on half a dozen servers. Sometimes
the same website is load balanced across multiple servers so figuring out
the "origin" of an error can be a challenging.

Right now we do this by examining the email headers of each error report,
and determining which SMTP server the error message originated from.
However we would like to moving away from having errors reported via email
(due to volume) and moving towards storing this information in a database
driven system. One of the caveats of doing this would be having a reliable
mechanism to determine the origin of an error.

I found a way to do this with WMI/vbscript but its CPU intensive and not
practical on a large scale. Two or three hits to the script, drive the
server CPU usage up by 10-20% or more. I'm hoping to find an equivalent way
to do this in ASP.NET which is much more efficient/scalable. Any guidance or
suggestions would be appreciated.

Thank You,
Brad
Apr 21 '06 #1
2 3131
Brad -

There are a few things you can try :

1. Put the server name in the web.config file and grab that information when
you send the email -- however since you have hundreds of server this may not
be an option for you.
2. You can use Server.MachineName to get name of the machine -- that can be
possibly added to your email logic
3. You can use Microsoft Application block for exceptions . It can provide
you with a lot more information when exceptions are thrown.

I think # 2 might be quickest for you right now

HTH
--
Swanand Mokashi
Microsoft Certified Solution Developer (.NET) - Early Achiever
Microsoft Certified Application Developer (.NET)

http://www.dotnetgenerics.com/
DotNetGenerics.com -- anything and everything about Microsoft .NET
technology ...

http://www.swanandmokashi.com/
http://www.swanandmokashi.com/HomePage/WebServices/
Home of the Stock Quotes, Quote of the day and Horoscope web services


"Brad Baker" <br**@nospam.nospam> wrote in message
news:eI**************@TK2MSFTNGP02.phx.gbl...
Using ASP.NET (or classic ASP) is there a way to capture the NETBIOS name
of the server that a page was run on?

Currently we have email based error reports which get sent to us from our
web sites. We have hundreds of websites on half a dozen servers. Sometimes
the same website is load balanced across multiple servers so figuring out
the "origin" of an error can be a challenging.

Right now we do this by examining the email headers of each error report,
and determining which SMTP server the error message originated from.
However we would like to moving away from having errors reported via
email (due to volume) and moving towards storing this information in a
database driven system. One of the caveats of doing this would be having a
reliable mechanism to determine the origin of an error.

I found a way to do this with WMI/vbscript but its CPU intensive and not
practical on a large scale. Two or three hits to the script, drive the
server CPU usage up by 10-20% or more. I'm hoping to find an equivalent
way to do this in ASP.NET which is much more efficient/scalable. Any
guidance or suggestions would be appreciated.

Thank You,
Brad

Apr 21 '06 #2
Hi Brad,

I agree with Swanand. Actually, it is exposed through the
System.Environment.MachineName Property, the MSDN document has said that
this property return the NetBios name of the local computer:

http://msdn2.microsoft.com/en-us/lib...chinename(VS.8
0).aspx

Regards,

Steven Cheng
Microsoft Online Community Support
==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Apr 24 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Snuffy2 | last post by:
I'm looking to try to get a users MAC and/or NetBIOS name when they visit my website. It somehow can be done, I'm not sure with PHP, but it can be done. Does anyone have any idea how? As an...
4
by: Dr. StrangeDub | last post by:
Leaving network identification/DNS out of the picture, how does one change the name of a computer in a local Workgroup (in C#)? I implemented the SetComputerName() API call and that only seems to...
4
by: rdonnici | last post by:
Hi all, Is there any way to, given an IP address(or NETBIOS machinename - I can convert from one to other) from my network, and assuming that everyone needs to log on a NT/2K/Windows Server 2003...
4
by: Michael Tissington | last post by:
Is it possible to read the NetBIOS domain name and if so how ? -- Michael Tissington http://www.oaklodge.com http://www.tabtag.com
2
by: adamcort | last post by:
I am trying to create a simple page for users to log printer issues on our PS4 Citrix farm. I have created a simple html form and published it on our intranet, the form only asks too questions,...
8
by: =?iso-8859-1?q?Magnus_T=F6rnvall?= | last post by:
Hi! I'm trying to write a program that can tell if a remote computer is running Windows or not. The thing is, it have to go very fast, so I don't want to "connect" to the computer. My plan is...
3
by: Erjan | last post by:
Hi, I am using TcpClient to connect to a device which does not talk NetBios. The TcpClient tries first to do something with Netbios. This probably failes on a timeout and then TcpClient sets up...
4
by: madankarmukta | last post by:
HI, I want to set my computername to be greate than 15 bytes.How can i do that since when i set the name greter that 15 bytes it's give me message that "The NetBIOS name of the computer is...
6
by: belias | last post by:
So...here we go. I'm having an issue with one computer on a network not being able to ping other computers by name. I've spent the last day searching similar issues and I've tried all the steps...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.