I would use -match instead of -like
For remote Eventlog you should use WMI or .NET
WMI: Get-WmiObject Win32_NTEventlogFile -computer $computer
or
..NET: [System.Diagnostics.EventLog]::GetEventLogs($computer)
I have examples of both here
http://bsonposh.com/modules/wordpress/?p=41
Brandon Shell
---------------
Blog: http://www.bsonposh.com/
PSH Scripts Project: www.codeplex.com/psobject
f> Hi,
f>
f> I am looking for "Lun" information from the eventlog and am wondering
f> why one method works and a couple others doesn't. Must be syntax.
f> The one that works is:
f>
f> get-eventlog -logname system|?{$_.timegenerated -gt "12/3/2007"|
f> findstr "Lun"
f>
f> The one that doesn't work is:
f>
f> get-eventlog -logname system|?{$_ -like "*Lun*"}
f> and
f> get-eventlog -logname system |?{$_.timegenerated -gt "12/3/2007"} |
f> select-string -pattern "Lun"
f> Also, how would I do this to a remote box?
f>
f> Thanks in advance,
f>


