Grab Windows Login in script?

06-07-2002, 08:27 AM
Is it possible to require a Windows login for a certain webfolder, then use the entered username throughout your ASP pages? I thought it may be part of the Server Object but haven't been able to find anything on the subject. Let me know if anyone knows where that username is stored and if it is accessable by my webpage - thanks!!!


Derek Stone
06-07-2002, 01:16 PM
You have to configure it in the server properties by using Windows Authentication. You can then use the AUTH_USER and LOGON_USER server variables to obtain the logged in user.

Good Luck

06-10-2002, 06:15 PM
My IIS server returns a value like "BLAHAH/loginname". So I use this Function to extract the person's actual username:<%
Private Function GetCurrentUser()

GetCurrentUser = _

End Function

06-11-2002, 06:24 AM
Thanks! That's almost exactly what I ended up using (the only difference being that I searched for the "\" and used everything after that instead of starting at a constant character) and it worked great. Sorry I forgot to come back on here and reply that I found a way to do it. Thanks for your suggestions! :)

EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum