Capture user credentials

I have a VB.NET console app that will run nightly via scheduler.  Also, this exe can be initiated by a small little ASP.NET web form I created that simply has a button that fires off the exe located on our server using some code I created in my aspx.vb file using the System.Diagnostics.Process namespace

How can I capture:

1) The UserID that is set in my sheduler who runs the exe every night via the scheduled task

2) The user who clicks on my button

I need to insert this information into a trail table so I need to know how to grab this info in both cases in VB.NET v2.0 specifically...please no VB.NET v1.0 or 1.1 here.
LVL 1
dba123Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Solar_FlareCommented:
does your site use authentication? if not then it will not be possible to capture the user as they will all be using anonymous access. If they are on a domain or logged in then something like HttpContext.Current.User.Identity.Name would get their username.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
ptleitchCommented:
There are probably several possiblities for you

I personnally add the user name in a session from the login control

Session.Add("UserName", Login1.UserName)

this is supposed to retrieve the user name as well, you could store it in any number of ways.  this will save it as a string

dim strUserName as String = User.Identity.Name

this forum relates to your question about the user id

http://forums.asp.net/thread/1238972.aspx

ptleitchCommented:
have you solved your problem?
dba123Author Commented:
Thanks, this is a start.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.