The System.PropertyBagData data type is used by several modules. A partial list of the modules is below.
- Microsoft.Windows.LdapProbe
- Microsoft.Windows.Win32ServiceInformationProbe
- Microsoft.Windows.DependentNTServiceStateProbe
- Microsoft.Windows.WmiEventProvider
This is just a partial list. The property bag is used in many modules because it is very flexible. It consists conceptually of a set of collections of name value pairs called properties. There is a default collection, which is all that most modules or scripts make use of, and there can also be named collections. The values are actually stored as Variants, so each property has a Name, VariantType, and a value.
Here is a sample property bag in XML form. It has the properties Computer, User2, and Bool in it's default collection. It has a named collection "TargetInstance" which has two properties, InsideUser and IntInside.
<DataItem type="System.PropertyBagData" time="2005-08-17T11:23:51.0870595-07:00">
<Property Name="Computer" VariantType="8">SAMPATTON01</Property>
<Property Name="User" VariantType="8">SamPattonOutside</Property>
<Property Name="User2" VariantType="8">SamPatton2</Property>
<Property Name="Bool" VariantType="11">true</Property>
<Collection Name="TargetInstance">
<Property Name="InsideUser" VariantType="8">SamPattonInside</Property>
<Property Name="IntInside" VariantType="3">17</Property>
</Collection>
</DataItem>
The XML version of the data type is important because rules and monitors access the data in a data type using XPath. A couple examples are below.
To access the Computer field, the XPath is Property[@Name='Computer']
To access the IntInside field, the XPath is Collection[@Name='TargetInstance']/Property[@Name='IntInside']
The queries above would evaluate to SAMPATTON01 and 17 respectively.
There is one more field in the property bag, the ConversionType. This field is only important for script generated property bags. I'll be adding more to this entry to cover that at a later time.