473,491 Members | 2,133 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

ComputerName of Remote User

I am attempting to retrieve the computer name of a remote user accessing our
websever. I have tried the following and both don't work. Any ideas?
Returns the webserver computer name

Set WshNetwork = CreateObject("WScript.Network")
response.write (wshNetwork.ComputerName)

Also tried this and I get a permissions error.

Set Sys = CreateObject("ADSystemInfo")
response.write (sys.ComputerName)

Jul 19 '05 #1
2 7658
The Web server will have the IP address of the remote computer, assuming
there is no proxy server, firewall, etc. between the remote computer and
your server. So, if you have the IP address, you can attempt to do a
reverse DNS lookup to convert the IP to the hostname. The quick and dirty
way to do it would be to "ping -a" the IP. Ping with the -a switch will
attempt to resolve the IP to a hostname.

Example:

<%
Dim sIP
Dim oShell, oExec, sCommand, sOutput
sIP = Request.ServerVariables("REMOTE_ADDR")
sCommand = "%comspec% /c @echo off & for /f ""tokens=2"" %q in ('ping -n
1 -a " & sIP & "^|find /i ""pinging""') do echo %q"
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCommand)
sOutput = oExec.StdOut.ReadAll
Set oExec = Nothing
Set oShell = NOthing
Response.WRite sOutput
%>

Ray at work
"dthmtlgod" <dv******@twcny.rr.com> wrote in message
news:uf*************@tk2msftngp13.phx.gbl...
I am attempting to retrieve the computer name of a remote user accessing
our
websever. I have tried the following and both don't work. Any ideas?
Returns the webserver computer name

Set WshNetwork = CreateObject("WScript.Network")
response.write (wshNetwork.ComputerName)

Also tried this and I get a permissions error.

Set Sys = CreateObject("ADSystemInfo")
response.write (sys.ComputerName)

Jul 19 '05 #2
Thanks a lot Ray, firewall is preventing me from obtaining the computer
name. Token 2 is the IP address.
"Ray Costanzo [MVP]" <my first name at lane 34 dot commercial> wrote in
message news:eq*************@TK2MSFTNGP12.phx.gbl...
The Web server will have the IP address of the remote computer, assuming
there is no proxy server, firewall, etc. between the remote computer and
your server. So, if you have the IP address, you can attempt to do a
reverse DNS lookup to convert the IP to the hostname. The quick and dirty
way to do it would be to "ping -a" the IP. Ping with the -a switch will
attempt to resolve the IP to a hostname.

Example:

<%
Dim sIP
Dim oShell, oExec, sCommand, sOutput
sIP = Request.ServerVariables("REMOTE_ADDR")
sCommand = "%comspec% /c @echo off & for /f ""tokens=2"" %q in ('ping -n
1 -a " & sIP & "^|find /i ""pinging""') do echo %q"
Set oShell = CreateObject("WScript.Shell")
Set oExec = oShell.Exec(sCommand)
sOutput = oExec.StdOut.ReadAll
Set oExec = Nothing
Set oShell = NOthing
Response.WRite sOutput
%>

Ray at work
"dthmtlgod" <dv******@twcny.rr.com> wrote in message
news:uf*************@tk2msftngp13.phx.gbl...
I am attempting to retrieve the computer name of a remote user accessing
our
websever. I have tried the following and both don't work. Any ideas?
Returns the webserver computer name

Set WshNetwork = CreateObject("WScript.Network")
response.write (wshNetwork.ComputerName)

Also tried this and I get a permissions error.

Set Sys = CreateObject("ADSystemInfo")
response.write (sys.ComputerName)


Jul 19 '05 #3

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

Similar topics

7
2943
by: Mindy Geac | last post by:
Hello, i'm new with ASP! How can I display the hosting computername on the website, We have 2 servers and I want to know which server I'm getting the asp pages from. thnx, Mindy
2
7065
by: Douglas Harber | last post by:
If I have DB2 8.1 (FP5, I believe, but not relevant to my question...I hope) installed on my desktop, do I have what I need to connect to a remote DB2 server (also running 8.1 FP5) from my desktop...
2
6575
by: Todd | last post by:
Is there a method I can use in C# that will set the ComputerName? Any Help would be appreciated. Thanks Todd
2
1812
by: Joseph | last post by:
Has anyone had any experience gathering the local computername through a web application with no client side program. I've been researching different avenues and have been coming up blank so far. ...
2
2886
by: Jon L. Lovesky | last post by:
Hello all, I am attempting to access a remote folder from an asp.net application (all within the same domain). The application is configured for windows authentication in IIS and the asp.net...
0
1209
by: amjad | last post by:
Dear All, I am using Visual Studio beta 2005 beta 2 with ASP.Net 2.0 and C#.I run the application and it work correctly with http://localhost:port/projectname/page but not with...
1
2806
by: James | last post by:
vb.net 2003 i wrote a windows service that does threading. My codes are a) the service thread will read a list of machine from a text file (machines.txt). b) it then logon using the below...
1
6865
by: Chris | last post by:
hi I have big problem. I am writing a small win application. It will work on remote MS SQL database (2005). Firstly, I need to log on to the server. The server supports remote connections and sql...
1
2659
by: usman211 | last post by:
i m using the following code for IP and ComputerName, it run accurately with our LAN but when i run it from some remote/hosting servers(like godaddy where the site is hosted) it get the IP of my...
0
7154
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
7190
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...
1
6858
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7360
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
4881
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4578
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3086
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1392
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
280
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.