472,141 Members | 1,563 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

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

Obtaining Local NETBIOS name and OS version?

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, Users Department and Problem description.

I however, am collecting more pertinant information on the asp
submission page. (time, date, username, IP address, etc)

The problem is I am trying to collect the OSVersion and Local Computer
Name as well.

When I try using;

Set objNet = CreateObject("WScript.NetWork")
strLocalName = objNet.ComputerName

strLocalName always gives me the name of the intranet server,
(basically the same results as using
Request.ServerVariables("SERVER_NAME").

I am trying to get the OS Version by performing a regread;

sOStype = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\ProductName")
sOSVersion = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\CSDVersion")
sOSBuild = oShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\BuildLab")
strFullOS = sOStype & " " & sOSVersion & "(" & sOSBuild & ")"

This also gives we the details of the server and not the client.

Has anybody done this before, and if so, can you let me know how!

Jun 6 '06 #1
2 3838
ad******@gmail.com wrote:
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, Users Department and Problem
description.

I however, am collecting more pertinant information on the asp
submission page. (time, date, username, IP address, etc)

The problem is I am trying to collect the OSVersion and Local Computer
Name as well.

When I try using;

Set objNet = CreateObject("WScript.NetWork")
strLocalName = objNet.ComputerName

strLocalName always gives me the name of the intranet server,
(basically the same results as using
Request.ServerVariables("SERVER_NAME").
:-) Well, duh! The code is running on the server.


I am trying to get the OS Version by performing a regread;
<snip> This also gives we the details of the server and not the client.
:-) Again, duh! Has anybody done this before, and if so, can you let me know how!

Run this code to see what client information is available to the
server-side code:

<%
dim vars, key
set vars = Request.servervariables
for each key in vars
response.write key & ": " & vars(key) & "<br>"
next
%>

See "HTTP_USER_AGENT"? You can get that directly by:

dim agent
agent = Request.servervariables("HTTP_USER_AGENT")

Then parse the string to get the OS info
(http://www.google.com/search?hl=en&l...2CGGLD%3A2005-
37%2CGGLD%3Aen&q=parse+OS++from+%22HTTP_USER_AGENT %22+&btnG=Search).

Be aware that this information
1) may not be accurate
2) can be spoofed

The only alternative is to convince the user to allow an ActiveX control
you create to be installed and run on his machine.

--
Microsoft MVP -- ASP/ASP.NET
Please reply to the newsgroup. The email account listed in my From
header is my spam trap, so I don't check it very often. You will get a
quicker response by posting to the newsgroup.
Jun 6 '06 #2
Cheer Bob,

Will try this tommorrow, and post my results.

I was aware that I would get the server name as, hey ASP is s e r v e r
s i d e!!!

However, I did set myself up a little in the post.

Jun 6 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

16 posts views Thread by Mike Malter | last post: by
2 posts views Thread by Mike Malter | last post: by
4 posts views Thread by Michael Tissington | last post: by
4 posts views Thread by Nathaniel Sherman | last post: by
2 posts views Thread by amirmira | last post: by
6 posts views Thread by Michael | last post: by
3 posts views Thread by Erjan | last post: by
reply views Thread by leo001 | last post: by

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.