Obtaining Local NETBIOS name and OS version?

A

adamcort

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!
 
B

Bob Barrows [MVP]

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;
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&lr=&c2coff=1&rls=GGLD,GGLD:2005-
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.
 
A

adamv6

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top