Retrieving and Displaying All Properties of a Managed Resource
Microsoft® Windows® 2000 Scripting Guide
One limitation of the script shown in Listing 6.23 is that it requires you to know, in advance, the names of all of the properties that you want to retrieve and display. However, what if you want to display values for all the properties of a class but you either do not know the property names or do not want to type the 40 or 50 lines of code required to display each property value? In that case, you can use the script in Listing 6.24, which automatically retrieves and displays the values of each property found in a class.
Listing 6.24 Template for Retrieving and Displaying All Properties of a Resource
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
|
To use this template with other WMI classes:
Set the value of strClassName to the appropriate WMI class.
If necessary, set the value of strNamespace to the appropriate WMI namespace.