The 2008 Winter Scripting Games

Sudden Death Challenge Event 5: WMI From A to Z – er, A to Y

Important: The deadline for this event has passed. You can find the solution here.

In WMI From A to Z – er, A to Y, competitors must come up with valid WMI property names that begin with the letters A through Y.

Note. The Sudden Death Challenge is a separate competition from the main Scripting Games and Scripting Games events; although anyone can enter the Sudden Death Challenge, it’s primarily designed for those people who manage to breeze through the main Scripting Games events in a day or two. To enter the main Scripting Games, click here. To enter Event 5 of the Sudden Death Challenge, well, keep reading.

*
On This Page
About This Sudden Death Challenge EventAbout This Sudden Death Challenge Event
Sudden Death Challenge Event ScenarioSudden Death Challenge Event Scenario
How to Enter This Sudden Death Challenge EventHow to Enter This Sudden Death Challenge Event

About This Sudden Death Challenge Event

Deadline

Monday, February 25, 2008 3:00 PM PST

Points Awarded

1 point in the Sudden Death Challenge

Top of pageTop of page

Sudden Death Challenge Event Scenario

To tell you the truth, it wouldn’t really be the Scripting Games unless we had at least one event that everyone complained was too hard and was completely unfair. Event 5 in the Sudden Death Challenge just happens to be that event.

Note. Actually, we don’t think Event 5 is all that hard; we were able to solve it using less than 25 lines of code. But, then again, we didn’t think Event 8 in the 2007 Scripting Games was all that hard, either.

For Event 5, we’re looking for the names of some WMI properties. But not just any WMI properties. Instead, we’re looking for properties whose names begin with the letters A through Y. In other words, we need a WMI property whose name begins with the letter A; a WMI property whose name begins with the letter B; a WMI property whose name begins with the letter C; and so on.

Of course, there are a few stipulations. To begin with, these properties must be drawn from WMI classes that reside in the root\cimv2 namespace; don’t use classes found in any other namespace. Second, these classes must be the so-called “Win32” classes; that means that the class name must begin with Win32_. That means you can use properties found in the Win32_Process or Win32_Service classes; however, you can’t use properties found in the CIM_DataFile class. That’s because CIM_DataFile doesn’t begin with Win32_.

Oh: and you must write a script that dynamically retrieves these property names. That script can be written using any of the official Scripting Games languages: VBScript, Windows PowerShell, or Perl.

To give you a better idea of what we’re looking for, here’s the data that our script returned:

AdditionalDescription   Win32_JobObjectStatus
BankLabel       Win32_PhysicalMemory
Caption Win32_OnBoardDevice
DriveName       Win32_VolumeChangeEvent
EventType       Win32_PowerManagementEvent
FileName        Win32_ModuleLoadTrace
GuaranteesDelivery      Win32_NetworkProtocol
HotSwappable    Win32_OnBoardDevice
ImageBase       Win32_ModuleLoadTrace
JobCountSinceLastReset  Win32_Printer
KernelModeTime  Win32_Process
LengthAllowed   Win32_SystemSlot
MachineName     Win32_ComputerSystemEvent
Name    Win32_OnBoardDevice
OEMEventCode    Win32_PowerManagementEvent
ProcessID       Win32_ModuleLoadTrace
QuotaNonPagedPoolUsage  Win32_Process
Removable       Win32_OnBoardDevice
SECURITY_DESCRIPTOR     Win32_ComputerSystemEvent
TIME_CREATED    Win32_ComputerSystemEvent
UserStackBase   Win32_ThreadStartTrace
Version Win32_OnBoardDevice
WaitMode        Win32_ThreadStartTrace
XOffCharacter   Win32_SerialPortConfiguration
Year     Win32_CurrentTime

As you can see, we echoed back the name of the property followed by the class in which that property was found. (For example, AdditionalDescription was found in the Win32_JobObjectStatus class.) Note that the properties that you return can – and probably will – be different from the ones our script returned. That doesn’t matter. The only thing that matters is that you end up with 25 properties: one whose name starts with the letter A; one whose name starts with the letter B; and so on.

Got all that? You’re right; this one is hard. (But after all, this is the Sudden Death Challenge.) We can’t really give you a hint on this one, but we can tell you this: somewhere in this section of the Script Repository is a script that you’ll find extremely useful when it comes time to tackle this event.

Top of pageTop of page

How to Enter This Sudden Death Challenge Event

After completing the script, click here to submit your entry. If the link doesn’t automatically open a pre-addressed message, send email to scripter@microsoft.com with the subject line Sudden Death Challenge: Event 5.

All you have to do is paste your solution into the body of the message and then send the mail. You may also include the following:

A name or nickname we can use to identify you when posting Sudden Death Challenge points leaders.

The name of the country you would like to represent. This might be your country of birth or the country you currently live in, but it doesn’t have to be; you can represent any country you wish.

Note that Sudden Death points/participation will not be included in either the User Group or International Challenges.

You can simply type these items in at the top of the email. In that case, your email might look something like this:

Ken Myer
USA
Northern Iowa User Group

For i = 1 to 100
    Wscript.Echo i
Next

Top of pageTop of page