Learn about Windows PowerShell
Summary: Beginner Event 3 of the 2011 Scripting Games uses Windows PowerShell to report details about classic event and ETL logs.
About this event
Date of Event
4/6/2011 12:01 AM
4/13/2011 12:01 AM
You are in charge of server monitoring at a medium-sized company that consists of three geographically dispersed sites and 50 servers. The servers are running a combination of Windows Server 2008 R2 and Windows Server 2008. You want to produce a report of all classic event logs and the ETL diagnostic logs that also exist. Your report should only list logs that are enabled. The list should be sorted by the last time the log was written to, and the most recent dates should be on top of the list. In addition, the report should state the size of the log, and whether or not it is a classic log. A sample output is shown in the following image.
2011 Scripting Games links
2011 Scripting Games: All Links on One Page
Submit your scripts on PoshCode
Support our Sponsors!
I invite you to follow me on Twitter and Facebook. If you have any questions, send email to me at firstname.lastname@example.org, or post your questions on the Official Scripting Guys Forum. Good luck as you compete in this year’s Scripting Games. We wish you well.
Ed Wilson, Microsoft Scripting Guy
Woo hoo! finally a script I was able to finish in one hour! The first one took me about 6hrs (for one crummy star :-]), the 2nd one about 4 hrs. Time to enjoy the fruit of my improvement (extra sleep!). Good luck everyone, good nite!
My first one went from a 2 to 1.5, so you're not alone in that boat. I'm thinking it was my if statements instead of actual error checking and the lack of a help file. This may help you some. I'm using this in all of them from now on. kevinpelgrims.wordpress.com/.../powershell This also reinforces what I've said several times before; IT is one of the few areas that when something is discovered that works, the first thing we do is share.
Thanks for the link :-) Originally I was using Powershell 2.0 TFM (i guess in support of one of the sponsors), and PowerShellHelp Community Edition as my main resources. At a judge's suggestion, I started using Weekend Scripter: 2010 Scripting Games Study Guide and that saved me hours for #2 and #3.
Event #1 took me forever because of my own foolish assumptions, because of the wording of the event, I thought that the file version for notepad was meant to mimick the private build; so I went on to figure out how to use regex matching between an input variable and the result of my get, I didn't realize that there was actual specific private build metadata! But anyway I don't regret the time spent; under different circumstances I may have skipped the hours of research.
Notepad, Powershell for Dummies, and Google. This one was the shortest of all three events so for to do for me, partly because I already knew the techniques and only needed to research a little bit.
Im getting murdered on there beginner event. I thought I nailed #3 even had a fancy html report but got a crummy 2 stars (my highest so far) and no comments , arg!
You should definately check out the 2011 Study Guide (on the all in one page) because most of the topics I cover in the games are also covered there. Also pay attention to the Scripting Wife articles because they are great beginner resources. Keep in mind that your scores will continue to change even after the games are completely over. This is because we have 30 judges, and all the scores are not due in until April 29, 2011. With an expected several thousand submissions, it can take a long time to rate all the scripts. Not all judges will grade all scripts. Not all judges will leave comments (grading them is the top priority) but some judges are leaving detailed comments (me for instance) but I do not think I will be able to grade all scripts. For example, the last script I graded took me 20 minutes! Multiple that time a couple thousand, and you can see I do not have the time to grade all that many scripts.