www.webdeveloper.com
Results 1 to 11 of 11

Thread: Windows username

  1. #1
    Join Date
    May 2004
    Posts
    7

    Windows username

    Does anybody know how I can get the Windows Username of my visitors? And could you please post your script in a running HTML.file? I know it can be done with ASP, unfortunately, that's no option...

  2. #2
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    It can only be done from the server... HTML definetely cannot do it.

    There 'may' be a JavaScript alternative, but it would not be very well supported.

    Regards.

  3. #3
    Join Date
    May 2004
    Posts
    7
    Well, it posted this similar message on the Java-board, and it dropped to page three within one day...

  4. #4
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    What are your options? Which languages can you use on your server?

    Regards.

  5. #5
    Join Date
    May 2004
    Posts
    7
    PHP and Javascript. We tried VBscript but the windows scripting host is not installed here. Are there VBScripts that don't use WSH?

  6. #6
    Join Date
    Jan 2004
    Location
    Melbourne, Australia
    Posts
    5,298
    JavaScript is client side. So the server cant influence it. Same applies to VBScript.

    Your server may not have support for ASP, but VBScript will work.

    To my knowledge, it cannot be done with PHP. ASP may be the only option.

    Regards,
    Andrew Buntine.

  7. #7
    Join Date
    Nov 2003
    Posts
    655
    If users have to log in using Windows Authentication to view pages, and you set the event logging on your server appropriately, you'll be able to find the info in the server's logs.

  8. #8
    Join Date
    May 2004
    Posts
    7
    I'm trrying very hard to prevent a logging in. It is a system on which users can report incidents involving the IT-infrastructure etc. so making a login screen is an extra step for the users. These users will be a little disgruntled to begin with, because their computer isn't acting the way they want it to.

    So logging on really is but a last resort...

  9. #9
    Join Date
    Jul 2005
    Posts
    2

    my solution

    i had the same problem with creating intranet pages. i needed user accounts. but why force users to type their usernames and passwords if i can get it from windows?
    well, the solution is not nice, but at least it is working.
    i created simple logon script, which contains this line:
    echo %USERNAME% > \\server\intranet$\userdata\%COMPUTERNAME%.txt
    and from php script i can access the very right file a read the username.
    this solutions is only useable when users use their own accounts.

  10. #10
    Join Date
    Jan 2006
    Posts
    1

    Nice patch hehehe !

    There must be a way to catch the windows username, but this is a nice workarround.
    I try some ways and put here the results.

    See u.

    Quote Originally Posted by georgoz
    i had the same problem with creating intranet pages. i needed user accounts. but why force users to type their usernames and passwords if i can get it from windows?
    well, the solution is not nice, but at least it is working.
    i created simple logon script, which contains this line:
    echo %USERNAME% > \\server\intranet$\userdata\%COMPUTERNAME%.txt
    and from php script i can access the very right file a read the username.
    this solutions is only useable when users use their own accounts.

  11. #11
    Join Date
    Jul 2005
    Posts
    2

    my solution^2

    I realized that I cant access the file by the name of the client computer. So I had to do a few changes. Now I access the file using IP adrress. The biggest problem was to extract the ip address from windows command line. There is my code:
    Code:
    @echo off
    for /f "delims=[ tokens=2" %%X in ('ping %computername% -n 1 -w 1 ^| find "PING"') do (
    for /f "delims=] tokens=1" %%C in ("%%X") do echo %username% %computername% %date% %time% > %%C
    )
    It creates a filename named by IP address with username, computer name, date and time inside. Now I am able to access it using REMOTE_ADDR. It is working on Win2k and WinXP. I am not sure about WinNT.

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



Recent Articles