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...
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.
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.
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.
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.
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.
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.
Bookmarks