View all users who was logged into particular computer during last day

Home Forums Scripting General Scripting View all users who was logged into particular computer during last day

Viewing 1 post (of 1 total)
  • Author
    Posts
  • Avatar
    igor7
    Member
    #154572

    I have Windows 2000 SP4 on a computer networked into a Windows 2003 AD network.
    Is there a way I can determine who was logged into this machine besides me during last 24 hours?
    I have tried Administrative Tools-Computer Management-Event Viewer-Security, and can sort by user,
    But – some of the users it lists make no sense, and the detail it lists when double-clicking on an event is gobbelty-gook to me…
    Sometime I’ve found useful utility PsLoggedOn, but it show only current logged in user. In additional I found powershell script:

    $a = read-host “Please input computer name here”

    $data = @()

    $NetLogs = Get-WmiObject Win32_NetworkLoginProfile -ComputerName $a
    foreach ($NetLog in $NetLogs) {
    if ($NetLog.LastLogon -match “(d{14})”) {
    $row = “” | Select Name,LogonTime
    $row.Name = $NetLog.Name
    $row.LogonTime=[datetime]::ParseExact($matches[0], “yyyyMMddHHmmss”, $null)
    $data += $row
    }
    }
    $data[/CODE]

    This script can retrive login info from remote computer, but still… somehow it show less info that I need…:

    [IMG]http://forums.petri.com/attachment.php?attachmentid=4813&stc=1&d=1305048670[/IMG]

    I know that users make logon/logoff to all our computers at least twice in a day…
    Is there a better way to determine successful logins to this machine?
    Thank you in advance,
    Igor[CODE]
    $a = read-host “Please input computer name here”

    $data = @()

    $NetLogs = Get-WmiObject Win32_NetworkLoginProfile -ComputerName $a
    foreach ($NetLog in $NetLogs) {
    if ($NetLog.LastLogon -match “(d{14})”) {
    $row = “” | Select Name,LogonTime
    $row.Name = $NetLog.Name
    $row.LogonTime=[datetime]::ParseExact($matches[0], “yyyyMMddHHmmss”, $null)
    $data += $row
    }
    }
    $data[/CODE]

    This script can retrive login info from remote computer, but still… somehow it show less info that I need…:

    [IMG]http://forums.petri.com/attachment.php?attachmentid=4813&stc=1&d=1305048670[/IMG]

    I know that users make logon/logoff to all our computers at least twice in a day…
    Is there a better way to determine successful logins to this machine?
    Thank you in advance,
    Igor

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.