Results 1 to 7 of 7

Thread: Can ASP be used to pick up a Computer name?

  1. #1
    Join Date
    Aug 2003
    Glasgow, Scotland

    Can ASP be used to pick up a Computer name?

    I'm not sure if this is possible...much less how to do it if it can be done!

    I'm writing an Intranet and we intend to use it for users to submit IT Support Requests, it would be very handy for us if 'something' could pick up the users computer name from their PC. (This is because computers are often on different sites and we can use PC Anywhere to access their machine). All too often the users have trouble finding their Computer name so it would be fantastic if the intranet could pick it up.....anyone know if this is possible?

    I don't want to keep it all in a database as PC's get formatted all the time and I'm not sure that people would keep a database up to date!

    Thanks for any help anyone can give.

  2. #2
    Join Date
    Dec 2004
    Eau Claire, WI
    What kind of network do the workstations run on? And what platform?

    I just accomplished this by changing some of the settings in IIS, but I believe you need to be on IIS 4 or higher, and the computers must be Win2k or higher..

    I will be at my office in about 45 minutes and will have the exact settings for you then..

    Brad Candell - Owner/Developer
    http://www.EauClaireWEB.com - Web Development

  3. #3
    Join Date
    Aug 2003
    Glasgow, Scotland
    At the moment our network is Windows 2000 server, we have a mixture of XP and NT for the users. The intranet will be hosted on a separate server (running Windows 2000 server).

    Ultimately everyone will have XP (hopefully by the end of January!) so if you're aware of a way this can be done....even if I have to implement it later it really would be a brilliant help!


  4. #4
    Join Date
    Dec 2004
    Eau Claire, WI
    It took me a great deal of time, and when I finally got it figured out, it was so simple..

    Here's the function I used:

    Function GetWorkstationName()
    strHostName = Request.ServerVariables("REMOTE_HOST")
    strUserName = Request.ServerVariables("REMOTE_USER")
    strUserName = Mid(strUserName, Instr(strUserName, "\") + 1, Len(strUserName))
    strDomainName = Left(Request.ServerVariables("REMOTE_USER"), Instr(Request.ServerVariables("REMOTE_USER"), "\") - 1)

    GetWorkstationName = strUserName
    End Function

    Now, this function requires a change of settings within IIS. I believe I had to inactivate Anonymous logins and Check the "Integrated Windows Authentication" box. It's been a while, so if that doesn't work we can compare IIS settings and come up with the solution for you..

    Brad Candell - Owner/Developer
    http://www.EauClaireWEB.com - Web Development

  5. #5
    Join Date
    Jun 2004
    Kansas City, MO
    candelbc is correct on how to set up the settings.

    I also have my intranet set up this was as i do not require a log in
    because i can see who is trying to access the intranet by the users Request.ServerVariables("REMOTE_USER").

    Also Request.ServerVariables("REMOTE_USER") is not the computer name.

    Its the username that the user uses to log on to their computer.
    My computer name is larryfxp but Request.ServerVariables("REMOTE_USER") will give me larryf which is my NT username that i use to log on to my computer(I could be wrong but i believe this is how it is)

    One other thing, this may pop up a windows log in box when you access your site asking the user for their username and password.

    If you have issues with this, change the settings in
    Tools/Internet Options/Security/Local Intranet/Customer Level
    Scroll to the bottom and youll see User authentication.
    You have 4 options.
    You can choose either
    Automatic Logon only in intranet zone.
    Automatic logon with current username and password.

    TO force the user to log on choose
    Prompt for user name and password.

    You can not choose
    Anonymous logon as you will get an error Unauthorized:logon fialed dut to server configuration.
    This should be enough to do what you are looking for.

  6. #6
    Join Date
    Dec 2004
    How do these settings change/affect things:

    -Inactivate Anonymous logins
    -Check the "Integrated Windows Authentication" box

    I don't know if my company will allow these settings on our Intranet... what problems will this bring about if they do make these changes. We have other pages on the Intranet where users have to log in.

  7. #7
    Join Date
    Jun 2004
    Kansas City, MO
    well what your doing is by unchecking
    Inactivate Anonymous logins and
    Check the "Integrated Windows Authentication" box
    is not allowing just anyone to view the pages.
    They must be part of your network.
    When you do this you can capture the user who is logged on.

    Im not sure but i think you can set this setting per page.

    When you do this based on the settings in your browser,
    the user will either be prompted for their username and password.
    or they will be allowed access.

    If your unsure set up a test site and see how it effects things.
    You would most likely have to change the way your site works as you
    would not want your users to have to log on twice.

    On the other hand its nice because unless your a part of the net work
    you will not have access.

    Also what i do is, i have a table set up in the DB with username, name, dept, and access rights to each part of the page. I do not make
    users log on because they are either granted access by their username and password becasue either they belong to the network or do not belong.
    Then when the try to access a page that is access restricted.
    I do a db search on their username, which you can get by using
    i then check to see if this user has access or not.

    This is alittle redundent because i keep a table of all the users.
    What i would like to do is use LDAP and hit active directory and
    get the users rights from their, but not set that up yet.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.09458 seconds
  • Memory Usage 2,898KB
  • Queries Executed 13 (?)
More Information
Template Usage (32):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (7)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (7)postbit
  • (7)postbit_onlinestatus
  • (7)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (70):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates