Print Page | Close Window

how to capture network USERID

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=5610
Printed Date: 30 March 2026 at 9:29pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: how to capture network USERID
Posted By: jeffrey.sweeney
Subject: how to capture network USERID
Date Posted: 08 September 2003 at 2:22pm
I've got an off the shelf application which is accessing an SQL database and retireving all sorts of corporate info etc. When you first launch the page the user is asked to put in initials and a password. This information is stored inside the SQL database and determines what the user can see & do to the other data. I would like to modify how this works so that when a user launches the page their network userID is used to determine their rights to the data. They are never prompted for a userID etc. I've got the database side of things all setup but I need to get the UserID. Ultimately the plan is to seemlessly incorporate this into part of our intranet.

Any help would be greatly appreciated. I apologize if my nomenclature is off but this all foreign to me.




Replies:
Posted By: michael
Date Posted: 08 September 2003 at 3:17pm
You get the Windows Username with Request.ServerVariables("Logon_User") or ("Auth_User") thus you would have to disable Anonymous access for this dir to use it successfully.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: jeffrey.sweeney
Date Posted: 09 September 2003 at 9:01am
This is a great start but it gives me the information in the following format:

domain\userId

Is there a way to isolate just the userID portion?


Posted By: michael
Date Posted: 09 September 2003 at 9:02am
Replace(Request.ServerVariables("Logon_User"),"domain\","")

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: jeffrey.sweeney
Date Posted: 09 September 2003 at 9:43am
This is what I put in:


var sUserID = Replace(Request.ServerVariables("Logon_User"),"AHCD\","");

Where AHCD is the domain name.

I receive the following error:

Error Type:
Microsoft JScript compilation (0x800A03F7)
Unterminated string constant
/authenticate/login.asp, line 35, column 74

I've also tried it this way (as well as a half doxen other variants):

var sUserID2 = String(Request.ServerVariables("Logon_User"));
var sUserID = String.Replace(sUserID2,"AHCD\","");

With the same error.

I appreciate your help!




Posted By: michael
Date Posted: 09 September 2003 at 1:28pm
Kill the ; this is not a sql script it is vbs

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: Mart
Date Posted: 10 September 2003 at 12:26pm
Hes using Jscript...


Posted By: michael
Date Posted: 10 September 2003 at 12:40pm
Ay, did not even notice that. Use server side vbscript...

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net