That's a great idea, these both worked:
CF:  (I got an error on the script, so I just changed it a little:):

<cfobject type="COM" name="w" class="WScript.Network" action="CREATE">
<cfoutput>#w.ComputerName#<br>#w.UserDomain#</cfoutput>

ASP:

<% 
set w = Server.CreateObject("WScript.Network")

computerName = w.ComputerName
userDomain = w.UserDomain

set w = nothing
response.write(computerName & userDomain)

 %>

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On
Behalf Of David L. Penton
Sent: Wednesday, April 24, 2002 9:41 AM
To: [EMAIL PROTECTED]
Subject: RE: Getting computer name via variables?



// untested

<cfscript>

w = CreateObject("WScript.Network");

computerName = w.ComputerName;
userDomain = w.UserDomain;

w = null;

</cfscript>


David L. Penton, Microsoft MVP
JCPenney Technical Specialist / Lead
"Mathematics is music for the mind, and Music is Mathematics for the
Soul. - J.S. Bach"
[EMAIL PROTECTED]

Do you have the VBScript Docs or SQL BOL installed?  If not, why not?
VBScript Docs: http://www.davidpenton.com/vbscript
SQL BOL: http://www.davidpenton.com/sqlbol


-----Original Message-----
From: Billy Cravens

Cgi.remote_host can sometimes give you that info, but isn't always
available (requires reverse lookups to have been setup, which isn't that
common for workstations/isp customers).  If you want the NetBIOS name or
NT domain, you're going to have to do more work - this is non-HTTP info.

---
Billy Cravens


-----Original Message-----
From: phumes1

Hi,

I'm using the below cgi variable to get the ipaddress of the server.

<cfset ipaddress = "#CGI.REMOTE_ADDR#">

How can I get the computer (server) name or domain?





+-----------------------------------------------------------------------
------------+

Philip Humeniuk
[EMAIL PROTECTED]
[EMAIL PROTECTED]
+-----------------------------------------------------------------------
-------------+


-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org



-------------------------------------------------------------------------
This email server is running an evaluation copy of the MailShield anti-
spam software. Please contact your email administrator if you have any
questions about this message. MailShield product info: www.mailshield.com

-----------------------------------------------
To post, send email to [EMAIL PROTECTED]
To subscribe / unsubscribe: http://www.dfwcfug.org

Reply via email to