?
Solved

how to parse userid from logon_user

Posted on 2010-01-09
6
Medium Priority
?
586 Views
Last Modified: 2012-05-08
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)
0
Comment
Question by:GessWurker
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 49

Accepted Solution

by:
Akhater earned 2000 total points
ID: 26273697
you mean something like

Dim userID,arrUser,uid

userID = Request.ServerVariables("LOGON_USER")
arrUser = Split (userID,"\")
uid = arrUser(0)
0
 

Author Comment

by:GessWurker
ID: 26273724
Something like that, yes, but... should check for the presence of a "\" first?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 26273744
sorry I didn't get what you mean ?
arrUser = Split (userID,"\") is splitting the userID at the "\"

0
Free learning courses: Active Directory Deep Dive

Get a firm grasp on your IT environment when you learn Active Directory best practices with Veeam! Watch all, or choose any amount, of this three-part webinar series to improve your skills. From the basics to virtualization and backup, we got you covered.

 

Author Comment

by:GessWurker
ID: 26273756
Sorry. Don't know asp. The code won't fail if no "\" is present?
0
 
LVL 49

Expert Comment

by:Akhater
ID: 26273839


if there is no "\" arrUser will be equal to userID
0
 

Author Comment

by:GessWurker
ID: 26273940
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!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A company’s centralized system that manages user data, security, and distributed resources is often a focus of criminal attention. Active Directory (AD) is no exception. In truth, it’s even more likely to be targeted due to the number of companies …
Group policies can be applied selectively to specific devices with the help of groups. Utilising this, it is possible to phase-in group policies, over a period of time, by randomly adding non-members user or computers at a set interval, to a group f…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
Suggested Courses
Course of the Month13 days, 17 hours left to enroll

801 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question