This sounds fine, except that the XML produced by export-clixml is not
RSS. Does anyone know how I can convert it (or can anyone offer any
advice?).
TIA, Mark
"Keith Hill [MVP]" <r_keit...@mailhot.moc_no_spam_I> wrote in message news:FDBAD9B7-0B2D-49F0...@microsoft.com..."Mark Wilson" <ma...@markwilson.co.uk> wrote in message news:1187826121.6...@r23g2000prd.googlegroups.com...
Try this - note it only is querying the last 100 entries of the system event log. Open up the generated RSS file in your favorite RSS reader and see how it looks.
--
Keith
File: EventLogRss.ps1
$events = get-eventlog System -newest 100 | sort TimeGenerated -desc
$rssFilename = 'c:\inetpub\wwwroot\eventlog.rss'
$rssContent = @"
<rss version="2.0">
<channel>
<title>System Event Log for $([Environment]::MachineName)</title>
<link>http://$([system.Net.Dns]::GetHostByName('localhost'))/$rssFilename</link>
"@
foreach ($item in $events) {
$rssContent += @"
<item>
<title>$($item.Index) - $($item.EntryType) - $($item.Source) - $($item.EventID)</title>
<pubDate>$($item.TimeGenerated.ToString('R'))</pubDate>
<description>$([System.Web.HttpUtility]::HtmlEncode($item.Message))</description>
</item>
"@
}
$rssContent += @"
</channel>
</rss>
"@
$rssContent > $rssFilename
Windows Server 2008 has a feature like this, but that likely doesn't
help you today...
Marco
--
----------------
PowerGadgets MVP
http://www.powergadgets.com/mvp
This RSS / ATOM library might come in handy if someone were to want to
create some more flexible scripts or cmdlets: http://www.codeplex.com/FeedDotNet
I was sure I saw mention of a RSS class being added in .NET 3.5, but I
have it installed, and cannot locate it.
You might also like www.rssbus.com, but if you're looking for remote
connectivity, I think they expect to charge for that.
Their desktop/local version is free.
There is a Rss20FeedFormatter class as well as an Atom10FeedFormatter class
in the System.ServiceModel.Syndication namespace. Cool.
--
Keith
"Syndication" is the key word I was missing/forgetting.
Thanks Keith.
More info on the RSSBus solution, if you install RSSBus on the machine
next to Powershell, you can convert any powershell command output into
an RSS feed (or atom, json, etc). It comes with a demo feed that is
generated by get-process.