|
-
Sep 14th, 2006, 09:27 PM
#1
Thread Starter
Frenzied Member
[2.0] Get user account that log to your PC.
Hi guys good day. How can I get users account that log to my pc? I tried it in WMI using win32_useraccount but there's no luck. I want to retrieve information such as user account and the last time she/he logon. Links and article will do.
Thanks in advance guys.
-
Sep 14th, 2006, 10:16 PM
#2
Re: [2.0] Get user account that log to your PC.
I'm not sure how to do that pragmatically, but you must enable the "Audit Logon Events"
Control Panel==>Administrative Tools==>Local Security settings==>Local Policies==>Audit Policy
Set the "Audit Logon Events" to success and optionally failure
now all you have to do is read the events from the Event Log and filter the category for "logon/logoff" events and search for the user name between the strings "User Name:" and "Domain:"
"I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
My Blog
-
Sep 14th, 2006, 10:33 PM
#3
Thread Starter
Frenzied Member
Re: [2.0] Get user account that log to your PC.
Thanks for the input mate. At least I see now on who log in my pc. My problem now is to get those information.
-
Sep 15th, 2006, 06:30 AM
#4
Re: [2.0] Get user account that log to your PC.
-
Sep 17th, 2006, 07:41 PM
#5
Thread Starter
Frenzied Member
Re: [2.0] Get user account that log to your PC.
Thanks for the great link hack. But it's seems it gets only the current user log in your pc not all the user and there's no specific log time of each user.
Can it be done in c# to enable the audit logon events?
-
Sep 18th, 2006, 09:10 AM
#6
Re: [2.0] Get user account that log to your PC.
Well I am not sure about it, but have you tried looking into WMI class "Win32_UserAccount"??
There are 3 more similar WMI classes: Win32_UserDesktop, Win32_SystemUsers, Win32_UserInDomain
-
Sep 18th, 2006, 07:49 PM
#7
Thread Starter
Frenzied Member
Re: [2.0] Get user account that log to your PC.
I have here a wmi code creator from microsoft and go through that classes but no luck.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|