<div class="content"><p>The SetValue method sets a user-defined value. The SetValue
method takes a name and value pair as BSTRs. This pair can either be used as
metadata for the <a href="f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_a6bcff77-b369-406d-9c0c-35a4771c1d0f" data-linktype="relative-path">data
collector set</a>, in which case it has no effect on the execution of the data
collector set, or it can be used as arguments for task execution. For example,
when a <a href="f43f48aa-80a5-4b39-971e-7b3ac0bd9d0d#gt_35645a67-9e0b-4c05-b2d9-3b2b25f2beac" data-linktype="relative-path">performance counter</a>
crosses a specified threshold, a scheduled task can run. In the event that
there exists a key/value pair that matches a task argument, PLA will substitute
the value as an argument to pass into the execution of that task. For more
information about using the Value field as task argument, see section <a href="7058da41-f7f5-498b-80e2-37b09286cae6" data-linktype="relative-path">3.2.4.1.39</a>. </p><dl>
<dd>
<div><pre> HRESULT SetValue(
   BSTR key,
   BSTR value
 );
</pre></div>
</dd></dl><p><b>key: </b>Supplies the name of the value. The key
cannot be the empty BSTR, but any other BSTR is a valid value. This key is
associated with, and can be used to retrieve, the value field.</p><p><b>value: </b>Supplies the value associated with the
key. This is any BSTR that is metadata that needs to be associated with the
data collector set or be passed as an argument when a specified task executes.</p><p><b>Return Values: </b>This method MUST return an
HRESULT with the severity bit clear on success as specified in <a href="../ms-erref/1bc92ddf-b79e-413c-bbaa-99a5281a6c90" data-linktype="relative-path">[MS-ERREF]</a>;
otherwise, it MUST return one of the errors as defined in <a href="590752a5-ddc3-49e4-9914-147a90bd0193" data-linktype="relative-path">2.2.1</a> or one of the errors
as defined in [MS-ERREF] section <a href="../ms-erref/0642cb2f-2075-4469-918c-4441e69c548a" data-linktype="relative-path">2.1</a>.</p></div>