<ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>MPAuthor.BusinessHours</ID>
      <Version>1.0.0.1</Version>
    </Identity>
    <Name>MPAuthor.BusinessHours</Name>
    <References>
      <Reference Alias="SC">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>6.1.7221.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>6.1.7221.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Health">
        <ID>System.Health.Library</ID>
        <Version>6.1.7221.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>6.1.7221.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="MPAuthor.BusinessHours.Target" Accessibility="Internal" Abstract="false" Base="Windows!Microsoft.Windows.ComputerRole" Hosted="true" Singleton="false" />
      </ClassTypes>
    </EntityTypes>
    <ModuleTypes>
      <DataSourceModuleType ID="MPAuthor.BusinessHours.DataSource.MyScriptScheduled" Accessibility="Internal" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="ComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="Successful" type="xsd:boolean" />
          <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer" />
          <xsd:element minOccurs="0" name="SyncTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="Successful" Selector="$Config/Successful$" ParameterType="bool" />
          <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" />
          <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" />
          <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="int" />
        </OverrideableParameters>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Schedule" TypeID="System!System.SimpleScheduler">
                <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
                <SyncTime>$Config/SyncTime$</SyncTime>
              </DataSource>
              <ProbeAction ID="Script" TypeID="MPAuthor.BusinessHours.Probe.MyScript">
                <ComputerName>$Config/ComputerName$</ComputerName>
                <Successful>$Config/Successful$</Successful>
              </ProbeAction>
              <ConditionDetection ID="ScheduleFilter" TypeID="System!System.SchedulerFilter">
                <SchedulerFilter>
                  <ProcessDataMode>OnSchedule</ProcessDataMode>
                  <Schedule>
                    <WeeklySchedule>
                      <Windows>
                        <Daily>
                          <Start>$Config/StartTime$</Start>
                          <End>$Config/EndTime$</End>
                          <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                        </Daily>
                      </Windows>
                    </WeeklySchedule>
                    <ExcludeDates />
                  </Schedule>
                </SchedulerFilter>
              </ConditionDetection>
            </MemberModules>
            <Composition>
              <Node ID="Script">
                <Node ID="ScheduleFilter">
                  <Node ID="Schedule" />
                </Node>
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>System!System.PropertyBagData</OutputType>
      </DataSourceModuleType>
      <DataSourceModuleType ID="MPAuthor.BusinessHours.ScheduledEventProvider" Accessibility="Public" Batching="false">
        <Configuration>
          <xsd:element minOccurs="1" name="EventNumber" type="xsd:string" />
          <xsd:element minOccurs="1" name="EventSource" type="xsd:string" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="string" />
        </OverrideableParameters>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <DataSource ID="Event" TypeID="Windows!Microsoft.Windows.EventProvider">
                <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
                <LogName>Application</LogName>
                <Expression>
                  <And>
                    <Expression>
                      <SimpleExpression>
                        <ValueExpression>
                          <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                        </ValueExpression>
                        <Operator>Equal</Operator>
                        <ValueExpression>
                          <Value Type="UnsignedInteger">$Config/EventNumber$</Value>
                        </ValueExpression>
                      </SimpleExpression>
                    </Expression>
                    <Expression>
                      <SimpleExpression>
                        <ValueExpression>
                          <XPathQuery Type="String">PublisherName</XPathQuery>
                        </ValueExpression>
                        <Operator>Equal</Operator>
                        <ValueExpression>
                          <Value Type="String">$Config/EventSource$</Value>
                        </ValueExpression>
                      </SimpleExpression>
                    </Expression>
                  </And>
                </Expression>
              </DataSource>
              <ConditionDetection ID="ScheduleFilter" TypeID="System!System.SchedulerFilter">
                <SchedulerFilter>
                  <ProcessDataMode>OnSchedule</ProcessDataMode>
                  <Schedule>
                    <WeeklySchedule>
                      <Windows>
                        <Daily>
                          <Start>$Config/StartTime$</Start>
                          <End>$Config/EndTime$</End>
                          <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                        </Daily>
                      </Windows>
                    </WeeklySchedule>
                    <ExcludeDates />
                  </Schedule>
                  <UseCurrentTime>true</UseCurrentTime>
                </SchedulerFilter>
              </ConditionDetection>
            </MemberModules>
            <Composition>
              <Node ID="ScheduleFilter">
                <Node ID="Event" />
              </Node>
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>Windows!Microsoft.Windows.EventData</OutputType>
      </DataSourceModuleType>
      <ProbeActionModuleType ID="MPAuthor.BusinessHours.Probe.MyScript" Accessibility="Internal" Batching="false" PassThrough="false">
        <Configuration>
          <xsd:element minOccurs="1" name="ComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="Successful" type="xsd:boolean" />
        </Configuration>
        <ModuleImplementation Isolation="Any">
          <Composite>
            <MemberModules>
              <ProbeAction ID="PSScript" TypeID="Windows!Microsoft.Windows.PowerShellPropertyBagTriggerOnlyProbe">
                <ScriptName>MyScript.ps1</ScriptName>
                <ScriptBody><![CDATA[
param($computerName,$testSuccessful)

$api = new-object -comObject 'MOM.ScriptAPI'
$api.LogScriptEvent('MyScript.ps1',803,4,"Running schedule script on $computerName . Test success: $testSuccessful.")
$bag = $api.CreatePropertyBag()
$bag.AddValue('ComputerName',$computerName)
if ($testSuccessful -eq $true)
	{$bag.AddValue('Value','Good')}
else
	{$bag.AddValue('Value','Bad')}

$bag
]]></ScriptBody>
                <Parameters>
                  <Parameter>
                    <Name>computerName</Name>
                    <Value>$Config/ComputerName$</Value>
                  </Parameter>
                  <Parameter>
                    <Name>testSuccessful</Name>
                    <Value>$Config/Successful$</Value>
                  </Parameter>
                </Parameters>
                <TimeoutSeconds>30</TimeoutSeconds>
              </ProbeAction>
            </MemberModules>
            <Composition>
              <Node ID="PSScript" />
            </Composition>
          </Composite>
        </ModuleImplementation>
        <OutputType>System!System.PropertyBagData</OutputType>
        <TriggerOnly>true</TriggerOnly>
      </ProbeActionModuleType>
    </ModuleTypes>
    <MonitorTypes>
      <UnitMonitorType ID="MPAuthor.BusinessHours.CheckNTServiceStateMonitorType.Scheduled" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="Running" NoDetection="false" />
          <MonitorTypeState ID="NotRunning" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <xsd:element minOccurs="1" name="ComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="ServiceName" type="xsd:string" />
          <xsd:element minOccurs="0" maxOccurs="1" name="CheckStartupType" type="xsd:string" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="CheckStartupType" Selector="$Config/CheckStartupType$" ParameterType="string" />
          <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="string" />
        </OverrideableParameters>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProvider">
              <ComputerName>$Config/ComputerName$</ComputerName>
              <ServiceName>$Config/ServiceName$</ServiceName>
              <Frequency>60</Frequency>
              <CheckStartupType>$Config/CheckStartupType$</CheckStartupType>
            </DataSource>
            <ProbeAction ID="Probe" TypeID="Windows!Microsoft.Windows.Win32ServiceInformationProbe">
              <ComputerName>$Config/ComputerName$</ComputerName>
              <ServiceName>$Config/ServiceName$</ServiceName>
            </ProbeAction>
            <ConditionDetection ID="ServiceRunning" TypeID="System!System.ExpressionFilter">
              <Expression>
                <Or>
                  <Expression>
                    <And>
                      <Expression>
                        <SimpleExpression>
                          <ValueExpression>
                            <Value Type="String">$Config/CheckStartupType$</Value>
                          </ValueExpression>
                          <Operator>NotEqual</Operator>
                          <ValueExpression>
                            <Value Type="String">false</Value>
                          </ValueExpression>
                        </SimpleExpression>
                      </Expression>
                      <Expression>
                        <SimpleExpression>
                          <ValueExpression>
                            <XPathQuery Type="Integer">Property[@Name='StartMode']</XPathQuery>
                          </ValueExpression>
                          <Operator>NotEqual</Operator>
                          <ValueExpression>
                            <Value Type="Integer">2</Value>
                          </ValueExpression>
                        </SimpleExpression>
                      </Expression>
                    </And>
                  </Expression>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value Type="Integer">4</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </Or>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="ServiceNotRunning" TypeID="System!System.ExpressionFilter">
              <Expression>
                <And>
                  <Expression>
                    <Or>
                      <Expression>
                        <SimpleExpression>
                          <ValueExpression>
                            <XPathQuery Type="Integer">Property[@Name='StartMode']</XPathQuery>
                          </ValueExpression>
                          <Operator>Equal</Operator>
                          <ValueExpression>
                            <Value Type="Integer">2</Value>
                          </ValueExpression>
                        </SimpleExpression>
                      </Expression>
                      <Expression>
                        <And>
                          <Expression>
                            <SimpleExpression>
                              <ValueExpression>
                                <Value Type="String">$Config/CheckStartupType$</Value>
                              </ValueExpression>
                              <Operator>Equal</Operator>
                              <ValueExpression>
                                <Value Type="String">false</Value>
                              </ValueExpression>
                            </SimpleExpression>
                          </Expression>
                          <Expression>
                            <SimpleExpression>
                              <ValueExpression>
                                <XPathQuery Type="Integer">Property[@Name='StartMode']</XPathQuery>
                              </ValueExpression>
                              <Operator>NotEqual</Operator>
                              <ValueExpression>
                                <Value Type="Integer">2</Value>
                              </ValueExpression>
                            </SimpleExpression>
                          </Expression>
                        </And>
                      </Expression>
                    </Or>
                  </Expression>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="Integer">Property[@Name='State']</XPathQuery>
                      </ValueExpression>
                      <Operator>NotEqual</Operator>
                      <ValueExpression>
                        <Value Type="Integer">4</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </And>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="ScheduleFilter" TypeID="System!System.SchedulerFilter">
              <SchedulerFilter>
                <ProcessDataMode>OnSchedule</ProcessDataMode>
                <Schedule>
                  <WeeklySchedule>
                    <Windows>
                      <Daily>
                        <Start>$Config/StartTime$</Start>
                        <End>$Config/EndTime$</End>
                        <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                      </Daily>
                    </Windows>
                  </WeeklySchedule>
                  <ExcludeDates />
                </Schedule>
                <UseCurrentTime>true</UseCurrentTime>
              </SchedulerFilter>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="Running">
              <Node ID="ServiceRunning">
                <Node ID="DS" />
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="NotRunning">
              <Node ID="ServiceNotRunning">
                <Node ID="ScheduleFilter">
                  <Node ID="DS" />
                </Node>
              </Node>
            </RegularDetection>
          </RegularDetections>
          <OnDemandDetections>
            <OnDemandDetection MonitorTypeStateID="Running">
              <Node ID="ServiceRunning">
                <Node ID="Probe" />
              </Node>
            </OnDemandDetection>
            <OnDemandDetection MonitorTypeStateID="NotRunning">
              <Node ID="ServiceNotRunning">
                <Node ID="Probe" />
              </Node>
            </OnDemandDetection>
          </OnDemandDetections>
        </MonitorImplementation>
      </UnitMonitorType>
      <UnitMonitorType ID="MPAuthor.BusinessHours.MonitorType.MyScriptScheduled" Accessibility="Internal">
        <MonitorTypeStates>
          <MonitorTypeState ID="Good" NoDetection="false" />
          <MonitorTypeState ID="Bad" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <xsd:element minOccurs="1" name="ComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="Successful" type="xsd:boolean" />
          <xsd:element minOccurs="1" name="IntervalSeconds" type="xsd:integer" />
          <xsd:element minOccurs="0" name="SyncTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="IntervalSeconds" Selector="$Config/IntervalSeconds$" ParameterType="int" />
          <OverrideableParameter ID="SyncTime" Selector="$Config/SyncTime$" ParameterType="string" />
          <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="int" />
        </OverrideableParameters>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="Script" TypeID="MPAuthor.BusinessHours.DataSource.MyScriptScheduled">
              <ComputerName>$Config/ComputerName$</ComputerName>
              <Successful>$Config/Successful$</Successful>
              <IntervalSeconds>$Config/IntervalSeconds$</IntervalSeconds>
              <SyncTime>$Config/SyncTime$</SyncTime>
              <StartTime>$Config/StartTime$</StartTime>
              <EndTime>$Config/EndTime$</EndTime>
              <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
            </DataSource>
            <ProbeAction ID="Probe" TypeID="MPAuthor.BusinessHours.Probe.MyScript">
              <ComputerName>$Config/ComputerName$</ComputerName>
              <Successful>$Config/Successful$</Successful>
            </ProbeAction>
            <ConditionDetection ID="FilterGood" TypeID="System!System.ExpressionFilter">
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Property[@Name='Value']</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">Good</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="FilterBad" TypeID="System!System.ExpressionFilter">
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">Property[@Name='Value']</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">Bad</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="Good">
              <Node ID="FilterGood">
                <Node ID="Script" />
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="Bad">
              <Node ID="FilterBad">
                <Node ID="Script" />
              </Node>
            </RegularDetection>
          </RegularDetections>
          <OnDemandDetections>
            <OnDemandDetection MonitorTypeStateID="Good">
              <Node ID="FilterGood">
                <Node ID="Probe" />
              </Node>
            </OnDemandDetection>
            <OnDemandDetection MonitorTypeStateID="Bad">
              <Node ID="FilterBad">
                <Node ID="Probe" />
              </Node>
            </OnDemandDetection>
          </OnDemandDetections>
        </MonitorImplementation>
      </UnitMonitorType>
      <UnitMonitorType ID="MPAuthor.BusinessHours.SingleEventLogMonitorType1.Scheduled" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="FirstEventRaised" NoDetection="false" />
          <MonitorTypeState ID="SecondEventRaised" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <IncludeSchemaTypes>
            <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
          </IncludeSchemaTypes>
          <xsd:element minOccurs="1" name="FirstComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="FirstLogName" type="xsd:string" />
          <xsd:element minOccurs="1" name="FirstExpression" type="ExpressionType" />
          <xsd:element minOccurs="1" name="SecondComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondLogName" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondExpression" type="ExpressionType" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="StartTime" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="string" />
        </OverrideableParameters>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="FirstDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider">
              <ComputerName>$Config/FirstComputerName$</ComputerName>
              <LogName>$Config/FirstLogName$</LogName>
            </DataSource>
            <DataSource ID="SecondDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider">
              <ComputerName>$Config/SecondComputerName$</ComputerName>
              <LogName>$Config/SecondLogName$</LogName>
            </DataSource>
            <ConditionDetection ID="FirstFilterCondition" TypeID="System!System.ExpressionFilter">
              <Expression>$Config/FirstExpression$</Expression>
            </ConditionDetection>
            <ConditionDetection ID="SecondFilterCondition" TypeID="System!System.ExpressionFilter">
              <Expression>$Config/SecondExpression$</Expression>
            </ConditionDetection>
            <ConditionDetection ID="Schedule" TypeID="System!System.SchedulerFilter">
              <SchedulerFilter>
                <ProcessDataMode>OnSchedule</ProcessDataMode>
                <Schedule>
                  <WeeklySchedule>
                    <Windows>
                      <Daily>
                        <Start>$Config/StartTime$</Start>
                        <End>$Config/EndTime$</End>
                        <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                      </Daily>
                    </Windows>
                  </WeeklySchedule>
                  <ExcludeDates />
                </Schedule>
                <UseCurrentTime>true</UseCurrentTime>
              </SchedulerFilter>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="FirstEventRaised">
              <Node ID="FirstFilterCondition">
                <Node ID="Schedule">
                  <Node ID="FirstDataSource" />
                </Node>
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="SecondEventRaised">
              <Node ID="SecondFilterCondition">
                <Node ID="SecondDataSource" />
              </Node>
            </RegularDetection>
          </RegularDetections>
        </MonitorImplementation>
      </UnitMonitorType>
      <UnitMonitorType ID="MPAuthor.BusinessHours.SingleEventLogMonitorType2.Scheduled" Accessibility="Public">
        <MonitorTypeStates>
          <MonitorTypeState ID="FirstEventRaised" NoDetection="false" />
          <MonitorTypeState ID="SecondEventRaised" NoDetection="false" />
        </MonitorTypeStates>
        <Configuration>
          <IncludeSchemaTypes>
            <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
          </IncludeSchemaTypes>
          <xsd:element minOccurs="1" name="FirstComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="FirstLogName" type="xsd:string" />
          <xsd:element minOccurs="1" name="FirstEventNumber" type="xsd:string" />
          <xsd:element minOccurs="1" name="FirstEventSource" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondComputerName" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondLogName" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondEventNumber" type="xsd:string" />
          <xsd:element minOccurs="1" name="SecondEventSource" type="xsd:string" />
          <xsd:element minOccurs="1" name="StartTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="EndTime" type="xsd:string" />
          <xsd:element minOccurs="1" name="DaysOfWeekMask" type="xsd:integer" />
        </Configuration>
        <OverrideableParameters>
          <OverrideableParameter ID="StartTIme" Selector="$Config/StartTime$" ParameterType="string" />
          <OverrideableParameter ID="EndTime" Selector="$Config/EndTime$" ParameterType="string" />
          <OverrideableParameter ID="DaysOfWeekMask" Selector="$Config/DaysOfWeekMask$" ParameterType="string" />
        </OverrideableParameters>
        <MonitorImplementation>
          <MemberModules>
            <DataSource ID="FirstDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider">
              <ComputerName>$Config/FirstComputerName$</ComputerName>
              <LogName>$Config/FirstLogName$</LogName>
            </DataSource>
            <DataSource ID="SecondDataSource" TypeID="Windows!Microsoft.Windows.BaseEventProvider">
              <ComputerName>$Config/SecondComputerName$</ComputerName>
              <LogName>$Config/SecondLogName$</LogName>
            </DataSource>
            <ConditionDetection ID="FirstFilterCondition" TypeID="System!System.ExpressionFilter">
              <Expression>
                <And>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value Type="UnsignedInteger">$Config/FirstEventNumber$</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="String">PublisherName</XPathQuery>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value Type="String">$Config/FirstEventSource$</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </And>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="SecondFilterCondition" TypeID="System!System.ExpressionFilter">
              <Expression>
                <And>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value Type="UnsignedInteger">$Config/SecondEventNumber$</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                  <Expression>
                    <SimpleExpression>
                      <ValueExpression>
                        <XPathQuery Type="String">PublisherName</XPathQuery>
                      </ValueExpression>
                      <Operator>Equal</Operator>
                      <ValueExpression>
                        <Value Type="String">$Config/SecondEventSource$</Value>
                      </ValueExpression>
                    </SimpleExpression>
                  </Expression>
                </And>
              </Expression>
            </ConditionDetection>
            <ConditionDetection ID="Schedule" TypeID="System!System.SchedulerFilter">
              <SchedulerFilter>
                <ProcessDataMode>OnSchedule</ProcessDataMode>
                <Schedule>
                  <WeeklySchedule>
                    <Windows>
                      <Daily>
                        <Start>$Config/StartTime$</Start>
                        <End>$Config/EndTime$</End>
                        <DaysOfWeekMask>$Config/DaysOfWeekMask$</DaysOfWeekMask>
                      </Daily>
                    </Windows>
                  </WeeklySchedule>
                  <ExcludeDates />
                </Schedule>
                <UseCurrentTime>true</UseCurrentTime>
              </SchedulerFilter>
            </ConditionDetection>
          </MemberModules>
          <RegularDetections>
            <RegularDetection MonitorTypeStateID="FirstEventRaised">
              <Node ID="FirstFilterCondition">
                <Node ID="Schedule">
                  <Node ID="FirstDataSource" />
                </Node>
              </Node>
            </RegularDetection>
            <RegularDetection MonitorTypeStateID="SecondEventRaised">
              <Node ID="SecondFilterCondition">
                <Node ID="SecondDataSource" />
              </Node>
            </RegularDetection>
          </RegularDetections>
        </MonitorImplementation>
      </UnitMonitorType>
    </MonitorTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="MPAuthor.BusinessHours.Discovery.Target" Enabled="true" Target="Windows!Microsoft.Windows.OperatingSystem" ConfirmDelivery="false" Remotable="true" Priority="Normal">
        <Category>Discovery</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="MPAuthor.BusinessHours.Target" />
        </DiscoveryTypes>
        <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.FilteredRegistryDiscoveryProvider">
          <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
          <RegistryAttributeDefinitions>
            <RegistryAttributeDefinition>
              <AttributeName>AppExists</AttributeName>
              <Path>SOFTWARE\MPAuthor\BusinessHours</Path>
              <PathType>0</PathType>
              <AttributeType>0</AttributeType>
            </RegistryAttributeDefinition>
          </RegistryAttributeDefinitions>
          <Frequency>3600</Frequency>
          <ClassId>$MPElement[Name="MPAuthor.BusinessHours.Target"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                <Name>$MPElement[Name="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Name>
                <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
              <Setting>
                <Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
                <Value>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
          <Expression>
            <SimpleExpression>
              <ValueExpression>
                <XPathQuery Type="String">Values/AppExists</XPathQuery>
              </ValueExpression>
              <Operator>Equal</Operator>
              <ValueExpression>
                <Value Type="String">True</Value>
              </ValueExpression>
            </SimpleExpression>
          </Expression>
        </DataSource>
      </Discovery>
    </Discoveries>
    <Rules>
      <Rule ID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled1" Enabled="true" Target="MPAuthor.BusinessHours.Target" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>Alert</Category>
        <DataSources>
          <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.EventProvider">
            <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
            <LogName>Application</LogName>
            <Expression>
              <And>
                <Expression>
                  <SimpleExpression>
                    <ValueExpression>
                      <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                    </ValueExpression>
                    <Operator>Equal</Operator>
                    <ValueExpression>
                      <Value Type="UnsignedInteger">103</Value>
                    </ValueExpression>
                  </SimpleExpression>
                </Expression>
                <Expression>
                  <SimpleExpression>
                    <ValueExpression>
                      <XPathQuery Type="String">PublisherName</XPathQuery>
                    </ValueExpression>
                    <Operator>Equal</Operator>
                    <ValueExpression>
                      <Value Type="String">EventCreate</Value>
                    </ValueExpression>
                  </SimpleExpression>
                </Expression>
              </And>
            </Expression>
          </DataSource>
        </DataSources>
        <ConditionDetection ID="ScheduleFilter" TypeID="System!System.SchedulerFilter">
          <SchedulerFilter>
            <ProcessDataMode>OnSchedule</ProcessDataMode>
            <Schedule>
              <WeeklySchedule>
                <Windows>
                  <Daily>
                    <Start>08:00</Start>
                    <End>17:00</End>
                    <DaysOfWeekMask>62</DaysOfWeekMask>
                  </Daily>
                </Windows>
              </WeeklySchedule>
              <ExcludeDates />
            </Schedule>
            <TimeXPathQuery>TimeXPathQuery</TimeXPathQuery>
          </SchedulerFilter>
        </ConditionDetection>
        <WriteActions>
          <WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">
            <Priority>1</Priority>
            <Severity>2</Severity>
            <AlertOwner />
            <AlertMessageId>$MPElement[Name="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled1.AlertMessage"]$</AlertMessageId>
            <AlertParameters>
              <AlertParameter1>$Data/EventDescription$</AlertParameter1>
            </AlertParameters>
            <Suppression />
            <Custom1 />
            <Custom2 />
            <Custom3 />
            <Custom4 />
            <Custom5 />
            <Custom6 />
            <Custom7 />
            <Custom8 />
            <Custom9 />
            <Custom10 />
          </WriteAction>
        </WriteActions>
      </Rule>
      <Rule ID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled2" Enabled="true" Target="MPAuthor.BusinessHours.Target" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>Alert</Category>
        <DataSources>
          <DataSource ID="DS" TypeID="MPAuthor.BusinessHours.ScheduledEventProvider">
            <EventNumber>103</EventNumber>
            <EventSource>EventCreate</EventSource>
            <StartTime>08:00</StartTime>
            <EndTime>17:00</EndTime>
            <DaysOfWeekMask>62</DaysOfWeekMask>
          </DataSource>
        </DataSources>
        <WriteActions>
          <WriteAction ID="Alert" TypeID="Health!System.Health.GenerateAlert">
            <Priority>1</Priority>
            <Severity>2</Severity>
            <AlertMessageId>$MPElement[Name="AlertMessageIDc9864edb5f2846b28764f552466866e0"]$</AlertMessageId>
            <AlertParameters>
              <AlertParameter1>$Data/EventDescription$</AlertParameter1>
            </AlertParameters>
          </WriteAction>
        </WriteActions>
      </Rule>
    </Rules>
    <Monitors>
      <UnitMonitor ID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="MPAuthor.BusinessHours.MonitorType.MyScriptScheduled" ConfirmDelivery="true">
        <Category>Custom</Category>
        <AlertSettings AlertMessage="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled_AlertMessageResourceID">
          <AlertOnState>Error</AlertOnState>
          <AutoResolve>true</AutoResolve>
          <AlertPriority>Normal</AlertPriority>
          <AlertSeverity>Error</AlertSeverity>
        </AlertSettings>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateId09d6d0ae50c9401799eb6b99ce643a9c" MonitorTypeStateID="Good" HealthState="Success" />
          <OperationalState ID="UIGeneratedOpStateIdb6389504ccb74466aabbbbf1bdf0c195" MonitorTypeStateID="Bad" HealthState="Error" />
        </OperationalStates>
        <Configuration>
          <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
          <Successful>true</Successful>
          <IntervalSeconds>600</IntervalSeconds>
          <StartTime>08:00</StartTime>
          <EndTime>17:00</EndTime>
          <DaysOfWeekMask>62</DaysOfWeekMask>
        </Configuration>
      </UnitMonitor>
      <UnitMonitor ID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="MPAuthor.BusinessHours.CheckNTServiceStateMonitorType.Scheduled" ConfirmDelivery="true">
        <Category>Custom</Category>
        <AlertSettings AlertMessage="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService_AlertMessageResourceID">
          <AlertOnState>Error</AlertOnState>
          <AutoResolve>true</AutoResolve>
          <AlertPriority>Normal</AlertPriority>
          <AlertSeverity>Error</AlertSeverity>
        </AlertSettings>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateIdd94291d08baa443c9d7595bf2399f85f" MonitorTypeStateID="Running" HealthState="Success" />
          <OperationalState ID="UIGeneratedOpStateId770300848c2f491ebb9d14a03e00dedd" MonitorTypeStateID="NotRunning" HealthState="Error" />
        </OperationalStates>
        <Configuration>
          <ComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</ComputerName>
          <ServiceName>alerter</ServiceName>
          <StartTime>08:00</StartTime>
          <EndTime>17:00</EndTime>
          <DaysOfWeekMask>62</DaysOfWeekMask>
        </Configuration>
      </UnitMonitor>
      <UnitMonitor ID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="MPAuthor.BusinessHours.SingleEventLogMonitorType1.Scheduled" ConfirmDelivery="true">
        <Category>AvailabilityHealth</Category>
        <AlertSettings AlertMessage="MPAuthor.BusinessHours.Monitor.ScheduledEvent1_AlertMessageResourceID">
          <AlertOnState>Error</AlertOnState>
          <AutoResolve>true</AutoResolve>
          <AlertPriority>Normal</AlertPriority>
          <AlertSeverity>Error</AlertSeverity>
          <AlertParameters>
            <AlertParameter1>$Data/Context/EventDescription$</AlertParameter1>
          </AlertParameters>
        </AlertSettings>
        <OperationalStates>
          <OperationalState ID="FirstEventRaised" MonitorTypeStateID="FirstEventRaised" HealthState="Error" />
          <OperationalState ID="SecondEventRaised" MonitorTypeStateID="SecondEventRaised" HealthState="Success" />
        </OperationalStates>
        <Configuration>
          <FirstComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</FirstComputerName>
          <FirstLogName>Application</FirstLogName>
          <FirstExpression>
            <And>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="UnsignedInteger">101</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">PublisherName</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">EventCreate</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </And>
          </FirstExpression>
          <SecondComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$</SecondComputerName>
          <SecondLogName>Application</SecondLogName>
          <SecondExpression>
            <And>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="UnsignedInteger">EventDisplayNumber</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="UnsignedInteger">102</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
              <Expression>
                <SimpleExpression>
                  <ValueExpression>
                    <XPathQuery Type="String">PublisherName</XPathQuery>
                  </ValueExpression>
                  <Operator>Equal</Operator>
                  <ValueExpression>
                    <Value Type="String">EventCreate</Value>
                  </ValueExpression>
                </SimpleExpression>
              </Expression>
            </And>
          </SecondExpression>
          <StartTime>08:00</StartTime>
          <EndTime>17:00</EndTime>
          <DaysOfWeekMask>62</DaysOfWeekMask>
        </Configuration>
      </UnitMonitor>
      <UnitMonitor ID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" ParentMonitorID="Health!System.Health.AvailabilityState" Remotable="true" Priority="Normal" TypeID="MPAuthor.BusinessHours.SingleEventLogMonitorType2.Scheduled" ConfirmDelivery="true">
        <Category>Custom</Category>
        <AlertSettings AlertMessage="MPAuthor.BusinessHours.Monitor.ScheduledEvent2_AlertMessageResourceID">
          <AlertOnState>Error</AlertOnState>
          <AutoResolve>true</AutoResolve>
          <AlertPriority>Normal</AlertPriority>
          <AlertSeverity>Error</AlertSeverity>
          <AlertParameters>
            <AlertParameter1>$Data/Context/EventDescription$</AlertParameter1>
          </AlertParameters>
        </AlertSettings>
        <OperationalStates>
          <OperationalState ID="UIGeneratedOpStateIde74be812629f41e9aa07df6ff757ded3" MonitorTypeStateID="FirstEventRaised" HealthState="Error" />
          <OperationalState ID="UIGeneratedOpStateId9e9109e2ffba42559b813a37047e62cc" MonitorTypeStateID="SecondEventRaised" HealthState="Success" />
        </OperationalStates>
        <Configuration>
          <FirstComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</FirstComputerName>
          <FirstLogName>Application</FirstLogName>
          <FirstEventNumber>101</FirstEventNumber>
          <FirstEventSource>EventCreate</FirstEventSource>
          <SecondComputerName>$Target/Host/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</SecondComputerName>
          <SecondLogName>Application</SecondLogName>
          <SecondEventNumber>102</SecondEventNumber>
          <SecondEventSource>EventCreate</SecondEventSource>
          <StartTime>08:00</StartTime>
          <EndTime>17:00</EndTime>
          <DaysOfWeekMask>62</DaysOfWeekMask>
        </Configuration>
      </UnitMonitor>
    </Monitors>
  </Monitoring>
  <Presentation>
    <Views>
      <View ID="MPAuthor.BusinessHours.View.Alerts" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" TypeID="SC!Microsoft.SystemCenter.AlertViewType" Visible="true">
        <Category>Operations</Category>
        <Criteria>
          <ResolutionState>
            <StateRange Operator="NotEquals">255</StateRange>
          </ResolutionState>
        </Criteria>
        <Presentation>
          <ColumnInfo Index="0" SortIndex="0" Width="22" Grouped="true" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Severity</Name>
            <Id>Severity</Id>
          </ColumnInfo>
          <ColumnInfo Index="1" SortIndex="-1" Width="54" Grouped="false" Sorted="false" IsSortable="false" Visible="true" SortOrder="Ascending">
            <Name>Icon</Name>
            <Id>Icon</Id>
          </ColumnInfo>
          <ColumnInfo Index="2" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Path</Name>
            <Id>MonitoringObjectPath</Id>
          </ColumnInfo>
          <ColumnInfo Index="3" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Source</Name>
            <Id>MonitoringObjectDisplayName</Id>
          </ColumnInfo>
          <ColumnInfo Index="4" SortIndex="-1" Width="22" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Maintenance Mode</Name>
            <Id>MonitoringObjectInMaintenanceMode</Id>
          </ColumnInfo>
          <ColumnInfo Index="5" SortIndex="-1" Width="250" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Name</Name>
            <Id>Name</Id>
          </ColumnInfo>
          <ColumnInfo Index="6" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Resolution State</Name>
            <Id>ResolutionState</Id>
          </ColumnInfo>
          <ColumnInfo Index="7" SortIndex="-1" Width="150" Grouped="false" Sorted="false" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Created</Name>
            <Id>TimeRaised</Id>
          </ColumnInfo>
          <ColumnInfo Index="8" SortIndex="1" Width="100" Grouped="false" Sorted="true" IsSortable="true" Visible="true" SortOrder="Ascending">
            <Name>Age</Name>
            <Id>Age</Id>
          </ColumnInfo>
          <ColumnInfo Index="9" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Type</Name>
            <Id>Category</Id>
          </ColumnInfo>
          <ColumnInfo Index="10" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Owner</Name>
            <Id>Owner</Id>
          </ColumnInfo>
          <ColumnInfo Index="11" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Priority</Name>
            <Id>Priority</Id>
          </ColumnInfo>
          <ColumnInfo Index="12" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Latency</Name>
            <Id>Latency</Id>
          </ColumnInfo>
          <ColumnInfo Index="13" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Description</Name>
            <Id>Description</Id>
          </ColumnInfo>
          <ColumnInfo Index="14" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Connector</Name>
            <Id>ConnectorId</Id>
          </ColumnInfo>
          <ColumnInfo Index="15" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Forwarding Status</Name>
            <Id>ConnectorStatus</Id>
          </ColumnInfo>
          <ColumnInfo Index="16" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Class</Name>
            <Id>Class</Id>
          </ColumnInfo>
          <ColumnInfo Index="17" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Time in State</Name>
            <Id>TimeInState</Id>
          </ColumnInfo>
          <ColumnInfo Index="18" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 1</Name>
            <Id>CustomField1</Id>
          </ColumnInfo>
          <ColumnInfo Index="19" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 2</Name>
            <Id>CustomField2</Id>
          </ColumnInfo>
          <ColumnInfo Index="20" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 3</Name>
            <Id>CustomField3</Id>
          </ColumnInfo>
          <ColumnInfo Index="21" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 4</Name>
            <Id>CustomField4</Id>
          </ColumnInfo>
          <ColumnInfo Index="22" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 5</Name>
            <Id>CustomField5</Id>
          </ColumnInfo>
          <ColumnInfo Index="23" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 6</Name>
            <Id>CustomField6</Id>
          </ColumnInfo>
          <ColumnInfo Index="24" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 7</Name>
            <Id>CustomField7</Id>
          </ColumnInfo>
          <ColumnInfo Index="25" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 8</Name>
            <Id>CustomField8</Id>
          </ColumnInfo>
          <ColumnInfo Index="26" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 9</Name>
            <Id>CustomField9</Id>
          </ColumnInfo>
          <ColumnInfo Index="27" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Custom Field 10</Name>
            <Id>CustomField10</Id>
          </ColumnInfo>
          <ColumnInfo Index="28" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Resolved By</Name>
            <Id>ResolvedBy</Id>
          </ColumnInfo>
          <ColumnInfo Index="29" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Time Resolved</Name>
            <Id>TimeResolved</Id>
          </ColumnInfo>
          <ColumnInfo Index="30" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Last State Change</Name>
            <Id>TimeResolutionStateLastModified</Id>
          </ColumnInfo>
          <ColumnInfo Index="31" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Last Modified</Name>
            <Id>LastModified</Id>
          </ColumnInfo>
          <ColumnInfo Index="32" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Last Modified By</Name>
            <Id>LastModifiedBy</Id>
          </ColumnInfo>
          <ColumnInfo Index="33" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Management Group</Name>
            <Id>ManagementGroup</Id>
          </ColumnInfo>
          <ColumnInfo Index="34" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Site</Name>
            <Id>SiteName</Id>
          </ColumnInfo>
          <ColumnInfo Index="35" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Repeat Count</Name>
            <Id>RepeatCount</Id>
          </ColumnInfo>
          <ColumnInfo Index="36" SortIndex="-1" Width="100" Grouped="false" Sorted="false" IsSortable="true" Visible="false" SortOrder="Ascending">
            <Name>Ticket ID</Name>
            <Id>TicketId</Id>
          </ColumnInfo>
        </Presentation>
        <Target />
      </View>
      <View ID="MPAuthor.BusinessHours.View.Target" Accessibility="Internal" Enabled="true" Target="MPAuthor.BusinessHours.Target" TypeID="SC!Microsoft.SystemCenter.StateViewType" Visible="true">
        <Category>StateCollection</Category>
        <Criteria />
      </View>
    </Views>
    <Folders>
      <Folder ID="MPAuthor.BusinessHours.Folder" Accessibility="Internal" ParentFolder="SC!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" />
    </Folders>
    <FolderItems>
      <FolderItem ElementID="MPAuthor.BusinessHours.View.Alerts" Folder="MPAuthor.BusinessHours.Folder" />
      <FolderItem ElementID="MPAuthor.BusinessHours.View.Target" Folder="MPAuthor.BusinessHours.Folder" />
    </FolderItems>
    <StringResources>
      <StringResource ID="AlertMessageIDc9864edb5f2846b28764f552466866e0" />
      <StringResource ID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled_AlertMessageResourceID" />
      <StringResource ID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService_AlertMessageResourceID" />
      <StringResource ID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1_AlertMessageResourceID" />
      <StringResource ID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2_AlertMessageResourceID" />
      <StringResource ID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled1.AlertMessage" />
    </StringResources>
  </Presentation>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="AlertMessageIDc9864edb5f2846b28764f552466866e0">
          <Name>Event 103</Name>
          <Description>Event Description: {0}</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours">
          <Name>MPAuthor Sample - Business Hours</Name>
          <Description>This management pack provides an example of configuring monitors and rules to run only during business hours.  Examples are provided for a service monitor, a monitor running a script, and monitors and rules based on a Windows event.  Two different monitor types are used for events.  These have identical functionality but illustrate two different strategies for configuring monitor types.

Each monitor and rule must specify parameters for the System.ScheduleFilter module.  StartTime and EndTime provide the time that the monitor or rule should begin functioning, while EndTime specifies the time that it should stop functioning.  DaysOfWeekMask specifies the days of the week that the schedule applies to as described in the following article: http://msdn.microsoft.com/en-us/library/ee692976(v=MSDN.10).aspx.

Both event monitors trigger a critical state from an event with a number of 101 and a source of EventCreate.  They return to healthy with an event number of 102.  The service monitor watches the running state of the Alerter service,  The script monitor will set a state according to the Successful parameter on the monitor type.  If the Successful parameter is false, then a critical state is set.  If the Succesful parameter is true, then a healthy state is set.

All rules and monitors are targeted at a class called MPAuthor.BusinessHours.Target.  This is discovered by creating a registry key at HKLM\SOFTWARE\MPAuthor\BusinessHours. This registry key must be on the same agent computer where the test events are created.</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.CheckNTServiceStateMonitorType.Scheduled">
          <Name> Business Hours NT Service Monitor Type</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.DataSource.MyScriptScheduled">
          <Name> Business Hours MyScript Scheduled</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Discovery.Target">
          <Name>MPAuthor Discover BusinessHours Target</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Folder">
          <Name>MPAuthor Sample Business Hours</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled">
          <Name>MyScript Scheduled</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled" SubElementID="UIGeneratedOpStateId09d6d0ae50c9401799eb6b99ce643a9c">
          <Name>Good</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled" SubElementID="UIGeneratedOpStateIdb6389504ccb74466aabbbbf1bdf0c195">
          <Name>Bad</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.MyScript.Scheduled_AlertMessageResourceID">
          <Name>Error from MyScript</Name>
          <Description>Please see the alert context for details.</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService">
          <Name>Alerter Service</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService" SubElementID="UIGeneratedOpStateId770300848c2f491ebb9d14a03e00dedd">
          <Name>NotRunning</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService" SubElementID="UIGeneratedOpStateIdd94291d08baa443c9d7595bf2399f85f">
          <Name>Running</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.Scheduled.AlerterService_AlertMessageResourceID">
          <Name>Alerter Service</Name>
          <Description>Please see the alert context for details.</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1">
          <Name>Scheduled Event 1</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1" SubElementID="FirstEventRaised">
          <Name>FirstEventRaised</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1" SubElementID="SecondEventRaised">
          <Name>SecondEventRaised</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent1_AlertMessageResourceID">
          <Name>Schedule Event 1</Name>
          <Description>Event Description: {0}</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2">
          <Name>Scheduled Event 2</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2" SubElementID="UIGeneratedOpStateId9e9109e2ffba42559b813a37047e62cc">
          <Name>SecondEventRaised</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2" SubElementID="UIGeneratedOpStateIde74be812629f41e9aa07df6ff757ded3">
          <Name>FirstEventRaised</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Monitor.ScheduledEvent2_AlertMessageResourceID">
          <Name>Scheduled Event 2</Name>
          <Description>Event Description: {0}</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.MonitorType.MyScriptScheduled">
          <Name> Business Hours MyScript Scheduled Monitor Type</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Probe.MyScript">
          <Name> Business Hours MyScript Probe</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled1">
          <Name>Alert on Event 1</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled1.AlertMessage">
          <Name>Event 103</Name>
          <Description>Event Description: {0}</Description>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Rule.AlertOnEvent.Scheduled2">
          <Name>Alert on Event 2</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.ScheduledEventProvider">
          <Name> Business Hours Scheduled Event Provider</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.SingleEventLogMonitorType1.Scheduled">
          <Name> Business Hours Single Event Log Monitor Type Scheduled</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.SingleEventLogMonitorType2.Scheduled">
          <Name> Business Hours Single Event Log Monitor Type With Hardocded Properties Scheduled</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.Target">
          <Name> MPAuthor BusinessHours Target</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.View.Alerts">
          <Name>Alerts</Name>
        </DisplayString>
        <DisplayString ElementID="MPAuthor.BusinessHours.View.Target">
          <Name>Target</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>
