Quantcast
Channel: Windows PowerShell Forum
Viewing all articles
Browse latest Browse all 2562

Using WMI date conversion for Win32_NTLogEvent reporting but can't get query to display results for TODAY only...

$
0
0

Hello

I'm trying to use this feature for reporting across LAN on a Server 2003 estate.

I understand the date conversion, but can't get my results to filter for today only.  It seems that Get-Date does not work with WMI.

This is what I have so far (the type of event is not really relevent, this is just an example as the logic will be used for many different reports if it is possible)...

$Query = Get-WMIObject Win32_NTLogEvent -Filter "logfile='application' and sourcename='symantec antivirus'"

$Query |
Select @{Name="LoggedOn";Expression={$_.ConvertToDateTime($_.TimeWritten)}},LogFile,SourceName

Hope you can help me.  I like PowerShell but this has been very annoying.

Thanks in advance...





Viewing all articles
Browse latest Browse all 2562

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>