GessWurker
asked on
how to parse userid from logon_user
myString = Request.ServerVariables("L OGON_USER" )
How do I parse the user id out of mystring? (i.e., I don't need the domain name, just the userid)
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
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
sorry I didn't get what you mean ?
arrUser = Split (userID,"\") is splitting the userID at the "\"
arrUser = Split (userID,"\") is splitting the userID at the "\"
ASKER
Sorry. Don't know asp. The code won't fail if no "\" is present?
if there is no "\" arrUser will be equal to userID
ASKER
Great! This seems to work perfectly:
userID = Request.ServerVariables("L OGON_USER" )
arrUser = Split (userID,"\")
uid = arrUser(1)
response.write("User name without domain: " & uid)
Thanks! Points to you!
userID = Request.ServerVariables("L
arrUser = Split (userID,"\")
uid = arrUser(1)
response.write("User name without domain: " & uid)
Thanks! Points to you!
ASKER