Obtaining Local NETBIOS name and OS version?

Discussion in 'ASP General' started by adamcort@gmail.com, Jun 6, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. 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&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.

    --
    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.
    Bob Barrows [MVP], Jun 6, 2006
    #2
    1. Advertising

  3. adamv6 Guest

    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.
    adamv6, Jun 6, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Michael Tissington

    NetBIOS Domain Name

    Michael Tissington, May 4, 2004, in forum: ASP .Net
    Replies:
    4
    Views:
    7,398
    Steven Cheng[MSFT]
    May 11, 2004
  2. Iwer M?rck

    Error 403.6 when using netbios name

    Iwer M?rck, Oct 9, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    380
    Iwer M?rck
    Oct 10, 2004
  3. Brad Baker
    Replies:
    3
    Views:
    12,175
    Spiralic
    Sep 10, 2009
  4. Mike

    ip address to netbios name

    Mike, Aug 1, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    87
    lostriver
    Aug 1, 2003
  5. Snuffy2

    Getting MAC & NetBIOS Name with Perl?

    Snuffy2, Oct 6, 2003, in forum: Perl Misc
    Replies:
    1
    Views:
    172
    James Willmore
    Oct 7, 2003
Loading...

Share This Page