Results 1 to 7 of 7

Thread: [2.0] Get user account that log to your PC.

  1. #1

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    [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.

  2. #2
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    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

  3. #3

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    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.

  4. #4
    I'm about to be a PowerPoster! Hack's Avatar
    Join Date
    Aug 2001
    Location
    Searching for mendhak
    Posts
    58,333

    Re: [2.0] Get user account that log to your PC.

    Try this

  5. #5

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    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?

  6. #6
    Smitten by reality Harsh Gupta's Avatar
    Join Date
    Feb 2005
    Posts
    2,938

    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
    Show Appreciation. Rate Posts.

  7. #7

    Thread Starter
    Frenzied Member mar_zim's Avatar
    Join Date
    Feb 2004
    Location
    Toledo Cebu City.
    Posts
    1,416

    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
  •  



Click Here to Expand Forum to Full Width