Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

trouble executing script to find archived users log on and off

$
0
0

I created a script so that I could put user log on and log off on our systems.  I came up with this after doing some research.  When I have it search the logs, there isn't any output.  I know for a fact that what I am looking for is there.  I would also like to export this to an excel document.  [:'(]

 

Get-ChildItem -Path c:\security\ -Recurse |
  ForEach-Object {
    "Parsing $($_.FullName)`r`n"
    {
      Get-WinEvent userid=JDOE -FilterHashtable @{
        logname   = 'security'
        id        = 4624, 4634, 4674
        userid    = JDOE
        Path      = $_.FullName
        Level     = 2
        StartTime = "4/1/16"
        EndTime   = "6/20/2016"
      } -EA Stop
    }
         }
  $array | Export-csv -path C:\security\results.csv

 

 

 


Viewing all articles
Browse latest Browse all 6937

Trending Articles