{"id":15811,"date":"2011-01-24T00:01:00","date_gmt":"2011-01-24T00:01:00","guid":{"rendered":"https:\/\/blogs.technet.microsoft.com\/heyscriptingguy\/2011\/01\/24\/use-powershell-cmdlet-to-filter-event-log-for-easy-parsing\/"},"modified":"2011-01-24T00:01:00","modified_gmt":"2011-01-24T00:01:00","slug":"use-powershell-cmdlet-to-filter-event-log-for-easy-parsing","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/scripting\/use-powershell-cmdlet-to-filter-event-log-for-easy-parsing\/","title":{"rendered":"Use PowerShell Cmdlet to Filter Event Log for Easy Parsing"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p><b>Summary<\/b>: Learn how to use the Get-WinEvent Windows PowerShell cmdlet to filter the event log prior to parsing it.<\/p>\n<p><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/q-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Question\" border=\"0\" title=\"Hey, Scripting Guy! Question\" \/> Hey, Scripting Guy! I am confused. I have enjoyed using the <b>Get-EventLog<\/b> Windows PowerShell cmdlet. It is fast, and easy to use. However, I do not always like the way it seems to return all the records from a remote computer before I can parse it with the <b>Where-Object<\/b> cmdlet. Why does it not support a <b>&ndash;filter<\/b> parameter?<\/p>\n<p>&#8212; RD<\/p>\n<p><img decoding=\"async\" height=\"34\" width=\"34\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/29\/2019\/02\/a-for-powertip.jpg\" align=\"left\" alt=\"Hey, Scripting Guy! Answer\" border=\"0\" title=\"Hey, Scripting Guy! Answer\" \/> Hello RD, <\/p>\n<p>Microsoft Scripting Guy Ed Wilson here. After SQL Saturday in Tampa, Florida, Dr. Scripto and I decided to head to the beach so we could play a little volleyball. The following action shot captures Dr. Scripto in peak beach volleyball form. <\/p>\n<p><a href=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/metablogapi\/1537.HSG-1-24-11-1_5EEA13F4.jpg\"><img decoding=\"async\" height=\"526\" width=\"604\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/metablogapi\/0363.HSG-1-24-11-1_thumb_3CB2086E.jpg\" alt=\"Image of Dr. Scripto in action on beach\" border=\"0\" title=\"Image of Dr. Scripto in action on beach\" style=\"border-bottom: 0px;border-left: 0px;padding-left: 0px;padding-right: 0px;border-top: 0px;border-right: 0px;padding-top: 0px\" \/><\/a><\/p>\n<p>Speaking of things that seem to bounce around, Windows PowerShell 2.0 introduces a new cmdlet to permit filtering of an event log prior to returning it to the workstation for additional parsing. I will admit that the <b>Get-EventLog<\/b> Windows PowerShell cmdlet is extremely easy to use. In Windows PowerShell 2.0, it even has a <b>computername<\/b><i> <\/i>parameter that provides easy access to remote event logs. There are a couple of problems with the <b>Get-EventLog<\/b> cmdlet. The first is that it must first return the log entries before they can be parsed with the <b>Where-Object<\/b> cmdlet. When working on a local computer, this might not be a huge issue, but when connecting across the network, it is better to filter the events at the remote computer before returning them to the local machine. The second issue with the <b>Get-EventLog<\/b> cmdlet is that it does not allow one to query the ETL type of logs; it is limited to the so-called &ldquo;traditional event logs&rdquo; such as the system, application, and security logs. The last problem with <b>Get-EventLog<\/b> is it is limited to online logs. When the event log is archived, <b>Get-EventLog<\/b> cannot access it. All of these problems are addressed with the <b>Get-WinEvent<\/b> cmdlet. <\/p>\n<p>Unfortunately, <b>Get-WinEvent<\/b> is not as easy to use as the <b>Get-EventLog<\/b> cmdlet. Confusion with <b>Get-WinEvent<\/b> begins with its name&mdash;it sounds as if it would have something to do with Windows events such as a shutdown event instead of event logs. It extends to the use of hash tables for filter mechanisms, and concludes with reading the event logs backward. But do not let these quirks scare you away from using an extremely powerful cmdlet. <\/p>\n<p>If I want to look at the most recent event from the application log on my computer, I use the <b>logname<\/b><i> <\/i>parameter and specify a value for <b>maxevents<\/b><i>. <\/i>In the example that follows, I use the number 1 to retrieve the most recent event in the application log (1 maximum event is the most recent event). I illustrate this technique with the code that appears here. <i><\/i><\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -LogName application -MaxEvents 1<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/16\/2011 11:41:11 AM&nbsp;&nbsp;&nbsp; Windows Error Reporting&nbsp;&nbsp;&nbsp;&nbsp; 1001&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Fault bucket , type 0&#8230;<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>If I want to see all of the entries in a particular event log (or ETL log), I do not specify a value for <b>maxevents<\/b><i>.<\/i> An example of doing that is shown here:<\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -LogName system<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/16\/2011 12:00:00 PM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; EventLog&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6013&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The system uptime is &#8230;<\/p>\n<p>1\/16\/2011 11:47:53 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Service Control Manager&nbsp;&nbsp;&nbsp;&nbsp; 7036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Application Exper&#8230;<\/p>\n<p>1\/16\/2011 11:47:20 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-Tim&#8230;&nbsp;&nbsp;&nbsp;&nbsp; 129&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; NtpClient was unable &#8230;<\/p>\n<p>1\/16\/2011 11:43:34 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Service Control Manager&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 7036&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Multimedia Class &#8230;<\/p>\n<p>&lt;output truncated&gt;<\/p>\n<\/blockquote>\n<p>When I use a hash table to filter events prior to returning them, the power of the cmdlet begins to show. A hash table uses the syntax of <b>key = value<\/b>, and each key must be unique. If I use the <b>FilterHashTable<\/b><i> <\/i>parameter, I am not able to supply a value for the <b>LogName<\/b><i> <\/i>parameter. I discovered this by examining the parameter sets that appear in the <b>Get-Help Get-WinEvent<\/b> help topic. The two applicable parameter sets appear here:<\/p>\n<blockquote>\n<p>Get-WinEvent [-LogName] &lt;string[]&gt; [-ComputerName &lt;string&gt;] [-Credential &lt;PSCredential&gt;] [-Filt<\/p>\n<p>erXPath &lt;string&gt;] [-Force &lt;switch&gt;] [-MaxEvents &lt;int64&gt;] [-Oldest] [&lt;CommonParameters&gt;]<\/p>\n<p>Get-WinEvent -FilterHashTable &lt;Hashtable[]&gt; [-ComputerName &lt;string&gt;] [-Credential &lt;PSCredential<\/p>\n<p>&gt;] [-Force &lt;switch&gt;] [-MaxEvents &lt;int64&gt;] [-Oldest] [&lt;CommonParameters&gt;]<\/p>\n<\/blockquote>\n<p>What this means is that I must include the log name in my hash table filter when I execute the command.&nbsp;The following table&nbsp;details the permitted key names and the associated data type of that associated value. Only two of the value fields accept wildcard characters. The <b>*<\/b> key represents a named event data field. <\/p>\n<table cellpadding=\"0\" cellspacing=\"0\" border=\"1\">\n<tbody>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p><strong>Key name<\/strong><\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p><strong>Value data type<\/strong><\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p><strong>Accepts wildcard characters?<\/strong><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>LogName<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;String[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>Yes<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>ProviderName<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;String[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>Yes<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>Path<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;String[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>Keywords<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;Long[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>ID<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;Int32[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>Level<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;Int32[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>StartTime<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;DateTime&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>EndTime<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;DataTime&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>UserID<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;SID&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>Data<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;String[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td width=\"224\" valign=\"top\">\n<p>*<\/p>\n<\/td>\n<td width=\"220\" valign=\"top\">\n<p>&lt;String[]&gt;<\/p>\n<\/td>\n<td width=\"194\" valign=\"top\">\n<p>No<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>Suppose I am concerned with events that are coming from <b>Capi2<\/b> with the EventID of 4107. When developing these types of filters, I always like to look at the actual event log record so that I can test my results to ensure the accuracy of my efforts. The particular event log entry I am interested in obtaining is shown in the following image. <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/msdnshared.blob.core.windows.net\/media\/TNBlogsFS\/prod.evol.blogs.technet.com\/CommunityServer.Blogs.Components.WeblogFiles\/00\/00\/00\/76\/18\/8267.HSG-1-24-11-2.jpg\" border=\"0\" \/><\/p>\n<p>To use the <b>Get-WinEvent<\/b> cmdlet to query the application log for event ID 4107, I create a hash table that will be supplied to the <b>FilterHashTable<\/b><i> <\/i>parameter. The key names (from the table above) do not need to be placed in quotation marks. The value data types that are listed as String or SID will need the quotation marks around it. The ID data type is an int32 and therefore does not need quotation marks around it. The resulting command appears here, along with the associated output. <\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -FilterHashtable @{logname=&#8217;application&#8217;; id=4107}<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/17\/2011 8:18:27 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>1\/16\/2011 11:32:02 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>1\/15\/2011 9:23:30 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>&lt;truncated output&gt;<\/p>\n<\/blockquote>\n<p>If I want to limit the output to events from the current day, I add the <b>StartTime<\/b> key. The <b>StartTime<\/b> key expects a <b>datetime<\/b> object. I therefore use the <b>Get-Date<\/b> Windows PowerShell cmdlet to retrieve the current date and time. I then specify that I only want today&rsquo;s date from the cmdlet. I do this by placing parentheses around the <b>Get-Date<\/b> cmdlet, and then using dotted notation to retrieve only the <b>date<\/b> property from the <b>System.DateTime<\/b> object that is returned by <b>Get-Date<\/b>. I knew which properties were available from the <b>System.DateTime<\/b> object because I used the <b>Get-Member<\/b> cmdlet to examine the properties. This is illustrated here:<\/p>\n<blockquote>\n<p>PS C:\\&gt; get-date | Get-Member -MemberType property<\/p>\n<p>TypeName: System.DateTime<\/p>\n<p>Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; MemberType&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Definition<\/p>\n<p>&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nb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&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.TimeSpan TimeOfDay {get;}<\/p>\n<p>Year&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Property&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.Int32 Year {get;}<\/p>\n<\/blockquote>\n<p>Next, I tested the command to ensure it returned what I expected. This technique is shown here:<\/p>\n<blockquote>\n<p>PS C:\\&gt; (get-date).date<\/p>\n<p>Monday, January 17, 2011 12:00:00 AM<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>After I had confirmed that the command worked as I expected, I incorporated it into my previous hash table filter. This is shown here, along with the associated output:<\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -FilterHashtable @{logname=&#8217;application&#8217;; id=4107; StartTime=(Get-Date).date}<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/17\/2011 8:18:27 AM&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>I then decided to try an experiment. Because the <b>StartTIme<\/b> key expects a <b>DateTime<\/b> data type, I wondered if I could give it a string and have it cast it to a <b>System.DateTime<\/b> object for me. I knew that I could do something like the following command and that I would receive a <b>DateTime<\/b> object:<\/p>\n<blockquote>\n<p>PS C:\\&gt; [datetime]&#8221;1\/17\/11&#8243;<\/p>\n<p>Monday, January 17, 2011 12:00:00 AM<\/p>\n<p>PS C:\\&gt; ([datetime]&#8221;1\/17\/11&#8243;).GetType()<\/p>\n<p>IsPublic&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; IsSerial&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Name&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; BaseType<\/p>\n<p>&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;-&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8211;<\/p>\n<p>True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; True&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; DateTime&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; System.ValueType<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>However, I was not certain that Windows PowerShell was smart enough to perform the conversion for me. Therefore, I decided to test it out. As you can see, the command worked out great:<\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -FilterHashtable @{logname=&#8217;application&#8217;; id=4107; StartTime=&#8221;1\/17\/11&#8243;}<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/17\/2011 8:18:27 AM&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>When I had the previous command working, I decided to see if I could use the same technique to retrieve a range of records. To do this, I used both the <b>StartTime<\/b> key and the <b>EndTime<\/b> key. The command and associated output appear here:<\/p>\n<blockquote>\n<p>PS C:\\&gt; Get-WinEvent -FilterHashtable @{logname=&#8217;application&#8217;;id=4107;StartTime=&#8221;1\/15\/11&#8243;;EndTime=&#8221;1<\/p>\n<p>\/17\/11&#8243;}<\/p>\n<p>TimeCreated&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ProviderName&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Id&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Message<\/p>\n<p>&#8212;&#8212;&#8212;&#8211;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;&#8212;&#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &#8212;&#8212;-<\/p>\n<p>1\/16\/2011 11:32:02 AM&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>1\/15\/2011 9:23:30 AM&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>1\/15\/2011 8:28:07 AM&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>1\/15\/2011 8:27:32 AM&nbsp;&nbsp;&nbsp;&nbsp; Microsoft-Windows-CAPI2&nbsp;&nbsp;&nbsp;&nbsp; 4107&nbsp;&nbsp;&nbsp;&nbsp; Failed extract of thi&#8230;<\/p>\n<p>PS C:\\&gt;<\/p>\n<\/blockquote>\n<p>RD, that is all there is to using the <b>Get-WinEvent<\/b> cmdlet. Neglected Cmdlet Week will continue tomorrow when I will talk about using the <b>Get-WinEvent<\/b> cmdlet to query offline event logs. <\/p>\n<p>I invite you to follow me on <a href=\"http:\/\/bit.ly\/scriptingguystwitter\">Twitter<\/a> and <a href=\"http:\/\/bit.ly\/scriptingguysfacebook\">Facebook<\/a>. If you have any questions, send email to me at <a href=\"mailto:scripter@microsoft.com\">scripter@microsoft.com<\/a>, or post your questions on the <a href=\"http:\/\/bit.ly\/scriptingforum\">Official Scripting Guys Forum<\/a>. See you tomorrow. Until then, peace.<\/p>\n<p>&nbsp;<\/p>\n<p><b>Ed Wilson, Microsoft Scripting Guy<\/b><\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; Summary: Learn how to use the Get-WinEvent Windows PowerShell cmdlet to filter the event log prior to parsing it. Hey, Scripting Guy! I am confused. I have enjoyed using the Get-EventLog Windows PowerShell cmdlet. It is fast, and easy to use. However, I do not always like the way it seems to return all [&hellip;]<\/p>\n","protected":false},"author":595,"featured_media":87096,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1],"tags":[97,51,98,3,4,45],"class_list":["post-15811","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-scripting","tag-event-logs","tag-getting-started","tag-logs-and-monitoring","tag-scripting-guy","tag-scripting-techniques","tag-windows-powershell"],"acf":[],"blog_post_summary":"<p>&nbsp; Summary: Learn how to use the Get-WinEvent Windows PowerShell cmdlet to filter the event log prior to parsing it. Hey, Scripting Guy! I am confused. I have enjoyed using the Get-EventLog Windows PowerShell cmdlet. It is fast, and easy to use. However, I do not always like the way it seems to return all [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/15811","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/users\/595"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/comments?post=15811"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/posts\/15811\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media\/87096"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/media?parent=15811"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/categories?post=15811"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/scripting\/wp-json\/wp\/v2\/tags?post=15811"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}