<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.technet.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>How Can I Return Only the Last Record Written to an Event Log?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/01/04/how-can-i-return-only-the-last-record-written-to-an-event-log.aspx</link><description>Hey, Scripting Guy! How can I read only the last record written to an event log? In other words, what is the WMI equivalent to the SQL statement Select Top 1 ? -- KM 
 Hey, KM. Well, as it turns out WMI doesn’t have an equivalent to the Select Top command;</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: How Can I Return Only the Last Record Written to an Event Log?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/01/04/how-can-i-return-only-the-last-record-written-to-an-event-log.aspx#3545454</link><pubDate>Fri, 11 Jan 2013 20:09:15 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3545454</guid><dc:creator>wizardpc</dc:creator><description>&lt;p&gt;What&amp;#39;s the 2008R2 equivalent for this? &lt;/p&gt;
&lt;p&gt;Set colLoggedEvents = objWMIService.ExecQuery _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;(&amp;quot;Select * From Win32_NTLogEvent Where Logfile = &amp;#39;Application&amp;#39; AND &amp;quot; &amp;amp; _&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;quot;RecordNumber = &amp;quot; &amp;amp; intRecords)&lt;/p&gt;
&lt;p&gt;...returns 0 records&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3545454" width="1" height="1"&gt;</description></item><item><title>re: How Can I Return Only the Last Record Written to an Event Log?</title><link>http://blogs.technet.com/b/heyscriptingguy/archive/2005/01/04/how-can-i-return-only-the-last-record-written-to-an-event-log.aspx#3359680</link><pubDate>Mon, 04 Oct 2010 13:55:06 GMT</pubDate><guid isPermaLink="false">d5e57398-b9ef-4490-9955-07cbb4e4a80d:3359680</guid><dc:creator>Greg</dc:creator><description>&lt;p&gt;I know this is old, but is this reliable? &amp;nbsp;I have heard that the Windows Event Log is a circular buffer, in that when the log is full, it will start dropping old logs to put in new ones. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;Does that mean that NumberOfRecords will not actually be returning the top recordnumber, and instead be returning the actual number of logs in the Event Log?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.technet.com/aggbug.aspx?PostID=3359680" width="1" height="1"&gt;</description></item></channel></rss>