Need a script to find the user logged into the machine. but i will be running this script as admin.
0 Comments   [ + ] Show Comments

Comments

Please log in to comment

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Answers

0
Can you keep a secret? There's a new-fangled thingy on the Web called 'Google'. You punch in words and it comes up with a list of sites whose pages contain those words. Now, not many people know about it at the moment so try to keep it between us, yeh?

If you have any problems using it, PM me your email address so I can send you my invoice for your training.
Answered 03/04/2009 by: VBScab
Red Belt

Please log in to comment
0
Tried that out before posting this query. And found many that gives the output as the user loged in as default user(as i am running the script in Cmd as Admin). What i required is that of the user loged onto the system.
Anyway thanks for the reminder.
Answered 03/04/2009 by: SHRIRAMVEN
Senior Yellow Belt

Please log in to comment
0
...which means that your search term was likely to have been sub-optimal, because this one:

vbscript +"logged in"

produced a script as the first hit which, having made the changes outlined in the thread, I used to enumerate a selection of 8 machines picked at random from my current client's domain.

Try again.
Answered 03/04/2009 by: VBScab
Red Belt

Please log in to comment
0
why don't you use a script that gets the "UserName" environment variable?

set objShell = CreateObject("WScript.Shell")
strUserName=objShell.ExpandEnvironmentStrings("%UserName%")
msgbox strUserName
Answered 03/11/2009 by: ditch_nz
Purple Belt

Please log in to comment
0
Thanks for the help guys. Issue is resolved now.
Answered 03/12/2009 by: SHRIRAMVEN
Senior Yellow Belt

Please log in to comment
0
why don't you use a script that gets the "UserName" environment variable?Because that would return the admin user's username. The OP wants to point a script at a machine and find out the username of the user who is logged-in to it.
Issue is resolved now. Perhaps you'd be good enough to share its resolution with the rest of the community?
Answered 03/12/2009 by: VBScab
Red Belt

Please log in to comment
Answer this question or Comment on this question for clarity