Jump to content

JG2015

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by JG2015

  1. Fantastic mate!! That's exactly what I needed. Can't thank you enough for your help. J.
  2. That's fantastic! You're a total genus! it's giving me the info i needed, but only against the first computer in the servers.txt file. I hate to ask, as you've helped me so much, but do you know why it doesn't go through a list of PCs in the servers.txt file? I think i owe you a drink or two mate j.
  3. Hi, thanks very much for your help. I've got the script to finally work, in that it gives me the data from that event log. Problem is, it doesn't give me the data I really needed which is the "Boot Duration" Arrrg! J.
  4. Thanks for reply, as you can probably tell i'm no scripting guru. You were correct that the log i'm trying to query is nested under "Applications and Services Logs\Microsoft\Windows\Diagnostics-Performance\Operational". So i've changed the script with your suggestions, but still bombs out. Script now looks like: $servers=get-content c:\scripts\servers.txt $date=(Get-Date).AddDays(-7) foreach ($server in $servers) { if (test-connection $server -quiet) { $arr1+=Get-WinEvent -FilterHashTable @{logname="Applications and Services Logs\Microsoft\Windows\Diagnostics-Performance\Operational" ;id=100;StartTime=$Date} -ComputerName $server } if ($arr1) {$arr1 | export-csv c:\scripts\sysoutput.csv -notypeinformation} else {"No matching system log events found..."} } The script has been cobbled together from a few i've found so might be things in there i don't need.
  5. Hi All, I've been trying to get a Power Shell script to gather a particular event log from a list of remote computers, but as yet not had much success. The script should query a list of PCs in c:\Scripts\server.txt and gather the "Operational" event log with ID 100 (i'm trying to get the boot up and login times on remote computers) Script looks like: $servers=get-content c:\scripts\servers.txt $date=(Get-Date).AddDays(-7) foreach ($server in $servers) { if (test-connection $server -quiet) { $arr1+=get-eventlog -logname Operational -entryType "Warning" -cn $server -after $date | ?{$_.eventid -eq "100" } | select MachineName,EventID,EntryType,Message } if ($arr1) {$arr1 | export-csv c:\scripts\sysoutput.csv -notypeinformation} else {"No matching system log events found..."} } But keeps returning the "no event logs found". Can anyone point me in the right direction please? Thanks for any help. J.
×
×
  • Create New...