Link to home
Start Free TrialLog in
Avatar of GessWurker
GessWurker

asked on

how to parse userid from logon_user

myString = Request.ServerVariables("LOGON_USER")

How do I parse the user id out of mystring? (i.e., I don't need the domain name, just the userid)
ASKER CERTIFIED SOLUTION
Avatar of Akhater
Akhater
Flag of Lebanon image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of GessWurker
GessWurker

ASKER

Something like that, yes, but... should check for the presence of a "\" first?
sorry I didn't get what you mean ?
arrUser = Split (userID,"\") is splitting the userID at the "\"

Sorry. Don't know asp. The code won't fail if no "\" is present?


if there is no "\" arrUser will be equal to userID
Great! This seems to work perfectly:

userID = Request.ServerVariables("LOGON_USER")
arrUser = Split (userID,"\")
uid = arrUser(1)
response.write("User name without domain: " & uid)

Thanks! Points to you!