Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting Windows Logon ID

Status
Not open for further replies.

IS300

MIS
Oct 29, 2003
121
0
0
CA
How do I get the login ID of the user within ASP? I also want to strip the domain or computer they are logged onto as well,

So instead of domain\userid or computername\userid, I want just userid.

Thanks
 
try something on the line like this

dName = UCase(CStr(Request("REMOTE_USER")))
i = InStr(1,dName,"\") + 1
dName = Mid(dName,i)
Response.Write "User is " & dName

should do the trick
 
to be absolutely correct then it might be best to put

dName = UCase(CStr(Request.ServerVariables("REMOTE_USER")))

instead of

dName = UCase(CStr(Request("REMOTE_USER")))

just incase you create another variable called "REMOTE_USER"
 
I tried this, it doesn't work.

The screen is blank, nothing prints on the screen. People are either logged onto our domain, or in a workgroup through a VPN connection
 
Just a thought....Remote user credentials are only passed if the Local IUser_Server and IWAM_Server don't have access to that ASP. If those accounts appears in the Security Permissions of that specific ASP take them out and replace them with the correct Domain groups to allow proper access to the page.

JR
 
cUsr = ucase( request.servervariables("LOGON_USER"))

' Remove domain
cUsr = right( cUser, len(cUsr) - instr(cUser, "\"))


but check the security tab in IIS (for the folder with this ASP): you need "integrated windows authentication"





hth,
Foxbox
ttmug.gif
 
Thanks, I figured it out. As long as the user is logged into our domain, I can get the ID.

The problem is that some users are not on our domain, rather in workgroups in field offices who basically VPN in through a router. I can capture their ID fine, but they would have to log into our domain first, which they would get prompted for the first time they try to open the page. We want to avoid having them log in in order to get their ID
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top