<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Enumerate The Remote Event Log with .NET</title>
	<atom:link href="http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/</link>
	<description>Sharing the Experience</description>
	<lastBuildDate>Fri, 03 Feb 2012 08:09:32 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Simon Matthes</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-885</link>
		<dc:creator>Simon Matthes</dc:creator>
		<pubDate>Wed, 21 Dec 2011 02:50:51 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-885</guid>
		<description>Hi,

I tried you above script with no success, i want to be able to run the script every couple of hours and get sent an event log for the server.  im a newb at powershell but when i run the script it returns with an email but no body. i think i only have version 1 of powershell, please help.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I tried you above script with no success, i want to be able to run the script every couple of hours and get sent an event log for the server.  im a newb at powershell but when i run the script it returns with an email but no body. i think i only have version 1 of powershell, please help.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohit Vohra</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-544</link>
		<dc:creator>Mohit Vohra</dc:creator>
		<pubDate>Tue, 07 Dec 2010 10:34:20 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-544</guid>
		<description>Hi,

I found the solution for this script: here you have used $logs[5].entries to check for security logs.

I tested this in powershell 2.0 and found that this will open the system logs; not security logs. So if you want to search for security events, including the ones mentioned in your example; you need to use: $logs[4].entries instead and then your reports should come.</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I found the solution for this script: here you have used $logs[5].entries to check for security logs.</p>
<p>I tested this in powershell 2.0 and found that this will open the system logs; not security logs. So if you want to search for security events, including the ones mentioned in your example; you need to use: $logs[4].entries instead and then your reports should come.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mohit Vohra</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-543</link>
		<dc:creator>Mohit Vohra</dc:creator>
		<pubDate>Tue, 07 Dec 2010 10:20:40 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-543</guid>
		<description>I tried the same script (without email portion) but used different event ids (529-537,539,644) to track for failed login attempts; however the script simply prints nothing.

Basically i am trying to find out the failed login instances on windows 2003 server. i had written a script in perl, but there&#039;s a limitation that perl cant be installed on the server; hence i need to re-write it in powershell / vbscript. I chose powershell as it looked to do most of the stuff that we can do in unix bash.
However this script is not printing anything; and i&#039;m afraid i&#039;m running out of time to accomplish this task.

Could someone pls help me in this? 
Appreciate your comments in this regards.

Adding my script for reference purposes
# Get the computer name
$computer = gc env:computername

# Get current date
$Now = get-date

#Get day before yesterday
$lastwrite = $Now.AddDays(-2)

$logs = [System.Diagnostics.EventLog]::GetEventLogs(“$computer”)

$colItems = $logs[5].entries

$events = @(&quot;529&quot;, &quot;530&quot;, &quot;531&quot;, &quot;532&quot;, &quot;533&quot;, &quot;534&quot;, &quot;535&quot;, &quot;537&quot;, &quot;539&quot;, &quot;644&quot;)

foreach ($item in $colItems)
{
	if (($events -contains $item.EventID))
	{
		$item.MachineName
		$item.EventID
		$item.TimeWritten
		$item.Category
		$item.EntryType
		$item.UserName
		$item.Data
		$item.Source
		$item.TimeGenerated
		$item.Message

	}
}</description>
		<content:encoded><![CDATA[<p>I tried the same script (without email portion) but used different event ids (529-537,539,644) to track for failed login attempts; however the script simply prints nothing.</p>
<p>Basically i am trying to find out the failed login instances on windows 2003 server. i had written a script in perl, but there&#8217;s a limitation that perl cant be installed on the server; hence i need to re-write it in powershell / vbscript. I chose powershell as it looked to do most of the stuff that we can do in unix bash.<br />
However this script is not printing anything; and i&#8217;m afraid i&#8217;m running out of time to accomplish this task.</p>
<p>Could someone pls help me in this?<br />
Appreciate your comments in this regards.</p>
<p>Adding my script for reference purposes<br />
# Get the computer name<br />
$computer = gc env:computername</p>
<p># Get current date<br />
$Now = get-date</p>
<p>#Get day before yesterday<br />
$lastwrite = $Now.AddDays(-2)</p>
<p>$logs = [System.Diagnostics.EventLog]::GetEventLogs(“$computer”)</p>
<p>$colItems = $logs[5].entries</p>
<p>$events = @(&#8220;529&#8243;, &#8220;530&#8243;, &#8220;531&#8243;, &#8220;532&#8243;, &#8220;533&#8243;, &#8220;534&#8243;, &#8220;535&#8243;, &#8220;537&#8243;, &#8220;539&#8243;, &#8220;644&#8243;)</p>
<p>foreach ($item in $colItems)<br />
{<br />
	if (($events -contains $item.EventID))<br />
	{<br />
		$item.MachineName<br />
		$item.EventID<br />
		$item.TimeWritten<br />
		$item.Category<br />
		$item.EntryType<br />
		$item.UserName<br />
		$item.Data<br />
		$item.Source<br />
		$item.TimeGenerated<br />
		$item.Message</p>
<p>	}<br />
}</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Steve</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-445</link>
		<dc:creator>Steve</dc:creator>
		<pubDate>Wed, 17 Feb 2010 17:14:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-445</guid>
		<description>Is there a way to pass domain credentials with this script so it can be run against a different domain?</description>
		<content:encoded><![CDATA[<p>Is there a way to pass domain credentials with this script so it can be run against a different domain?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumudro</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-429</link>
		<dc:creator>Sumudro</dc:creator>
		<pubDate>Wed, 18 Nov 2009 14:02:34 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-429</guid>
		<description>The script run with email facility with 32-bit pc events log. With 64-bit Exchange Server 2007, it&#039;s not retruning events log. I checked $colItems.count returning 0, so that the for loop is not working and then logs return. Anyone has any solution. Thanks</description>
		<content:encoded><![CDATA[<p>The script run with email facility with 32-bit pc events log. With 64-bit Exchange Server 2007, it&#8217;s not retruning events log. I checked $colItems.count returning 0, so that the for loop is not working and then logs return. Anyone has any solution. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sumudro</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-428</link>
		<dc:creator>Sumudro</dc:creator>
		<pubDate>Wed, 18 Nov 2009 13:05:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-428</guid>
		<description>I am new in PowerShell. The event log script is great. I ran without email that is ok.  I also run with email, but the email body is showing empty. I am not sure the function EvtReader is returning empty string or ..... Can anyone reply, why i am getting no logs as body as email. Thanks</description>
		<content:encoded><![CDATA[<p>I am new in PowerShell. The event log script is great. I ran without email that is ok.  I also run with email, but the email body is showing empty. I am not sure the function EvtReader is returning empty string or &#8230;.. Can anyone reply, why i am getting no logs as body as email. Thanks</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: J Kavanagh</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-400</link>
		<dc:creator>J Kavanagh</dc:creator>
		<pubDate>Fri, 28 Aug 2009 20:21:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-400</guid>
		<description>Okay so you now the value for $logs[#] but the number of logs is not the same (depending on OS, products installed, etc...) is there a way to for example get the System log entries?</description>
		<content:encoded><![CDATA[<p>Okay so you now the value for $logs[#] but the number of logs is not the same (depending on OS, products installed, etc&#8230;) is there a way to for example get the System log entries?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jesse Hamrick</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-359</link>
		<dc:creator>Jesse Hamrick</dc:creator>
		<pubDate>Thu, 18 Jun 2009 22:34:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-359</guid>
		<description>Create the following variables and add it as part of the filter:
$Now = Get-Date
$lastWrite = $Now.AddDays(-7)

#now place in filter
-and($_.TimeWritten -ge $lastWrite)

I haven&#039;t tested it yet but this works in other scripts I&#039;ve written which get all errors recorded within last 7 days...</description>
		<content:encoded><![CDATA[<p>Create the following variables and add it as part of the filter:<br />
$Now = Get-Date<br />
$lastWrite = $Now.AddDays(-7)</p>
<p>#now place in filter<br />
-and($_.TimeWritten -ge $lastWrite)</p>
<p>I haven&#8217;t tested it yet but this works in other scripts I&#8217;ve written which get all errors recorded within last 7 days&#8230;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brad B</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-358</link>
		<dc:creator>Brad B</dc:creator>
		<pubDate>Thu, 18 Jun 2009 22:18:01 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-358</guid>
		<description>Great script...  But I too would like to narrow down the results to 7 days or 24 hours..
Still new to PS</description>
		<content:encoded><![CDATA[<p>Great script&#8230;  But I too would like to narrow down the results to 7 days or 24 hours..<br />
Still new to PS</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sal</title>
		<link>http://www.powershellpro.com/enumerate-the-remote-event-log-with-net/280/comment-page-1/#comment-319</link>
		<dc:creator>Sal</dc:creator>
		<pubDate>Mon, 13 Apr 2009 19:55:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.powershellpro.com/?p=280#comment-319</guid>
		<description>This script is great.  Do you know of a way to add multiple host and filter by, say last   7 days?

Thanks</description>
		<content:encoded><![CDATA[<p>This script is great.  Do you know of a way to add multiple host and filter by, say last   7 days?</p>
<p>Thanks</p>
]]></content:encoded>
	</item>
</channel>
</rss>

