<ManagementPack ContentReadable="true" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  <Manifest>
    <Identity>
      <ID>Microsoft.SystemCenter.Runtime.RunAs</ID>
      <Version>6.0.7043.0</Version>
    </Identity>
    <Name>RunAs Test Management Pack</Name>
    <References>
      <Reference Alias="SC">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>6.0.0.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>6.0.0.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>6.0.0.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <SecureReferences>
      <SecureReference ID="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile" Accessibility="Public" Context="System!System.Entity" />
      <SecureReference ID="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile.Next" Accessibility="Public" Context="System!System.Entity" />
    </SecureReferences>
  </TypeDefinitions>
  <Monitoring>
    <Rules>
      <Rule ID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Rule" Enabled="true" Target="SC!Microsoft.SystemCenter.HealthService" ConfirmDelivery="true" Remotable="true" Priority="Normal" DiscardLevel="100">
        <Category>EventCollection</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>
              <SimpleExpression>
                <ValueExpression>
                  <XPathQuery>EventDisplayNumber</XPathQuery>
                </ValueExpression>
                <Operator>Equal</Operator>
                <ValueExpression>
                  <Value Type="UnsignedInteger">999</Value>
                </ValueExpression>
              </SimpleExpression>
            </Expression>
          </DataSource>
        </DataSources>
        <WriteActions>
          <WriteAction ID="PA2" TypeID="System!System.CommandExecuter">
            <ApplicationName><![CDATA[%windir%\system32\cmd.exe]]></ApplicationName>
            <WorkingDirectory />
            <CommandLine><![CDATA[/c echo  $RunAs[Name="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile"]/UserName$ $RunAs[Name="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile.Next"]/Password$ > %windir%\temp\EmptyProfile.txt]]></CommandLine>
            <TimeoutSeconds>15</TimeoutSeconds>
            <RequireOutput>true</RequireOutput>
            <Files />
          </WriteAction>
        </WriteActions>
      </Rule>
    </Rules>
    <Tasks>
      <Task ID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Task" Accessibility="Public" Enabled="true" Target="SC!Microsoft.SystemCenter.HealthService" Timeout="300" Remotable="true">
        <Category>Maintenance</Category>
        <WriteAction ID="Probe" TypeID="System!System.CommandExecuter">
          <ApplicationName><![CDATA[%WinDir%\System32\cmd.exe]]></ApplicationName>
          <WorkingDirectory />
          <CommandLine>/c "echo $RunAs[Name="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile"]/UserName$"</CommandLine>
          <TimeoutSeconds>30</TimeoutSeconds>
          <RequireOutput>true</RequireOutput>
        </WriteAction>
      </Task>
    </Tasks>
  </Monitoring>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="false">
      <DisplayStrings>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs">
          <Name>Test Secure Reference Alerts</Name>
          <Description>This management pack tests some of the Secure Referenece Override alerts ...</Description>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile">
          <Name>Empty Profile</Name>
          <Description>This is profile which has no action account associated. It means that default is used and all $RunAs replacements will fail.</Description>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.EmptyAccountProfile.Next">
          <Name>Empty Profile - Another</Name>
          <Description>This is profile which has no action account associated. It means that default is used and all $RunAs replacements will fail.</Description>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Rule">
          <Name>Test Empty Profile - Rule</Name>
          <Description>This is rule testing the use of the profile which has no action account associated. It means that default is used and all $RunAs replacements will fail.</Description>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Rule" SubElementID="DS">
          <Name>Data source</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Rule" SubElementID="PA2">
          <Name>Write action</Name>
          <Description />
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Task">
          <Name>Test Empty Profile - Task</Name>
          <Description>This is task testing the use of the profile which has no action account associated. It means that default is used and all $RunAs replacements will fail.</Description>
        </DisplayString>
        <DisplayString ElementID="Microsoft.SystemCenter.Runtime.RunAs.Test.NotDefined.Task" SubElementID="Probe">
          <Name>Probe</Name>
          <Description />
        </DisplayString>
      </DisplayStrings>
      <KnowledgeArticles>
        <KnowledgeArticle ElementID="Microsoft.SystemCenter.Runtime.RunAs" Visible="true">
          <MamlContent>
            <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10">
              <maml:title>Summary</maml:title>
              <maml:para>This management pack tests some of the Secure Referenece Override alerts ...</maml:para>
            </maml:section>
            <maml:section xmlns:maml="http://schemas.microsoft.com/maml/2004/10">
              <maml:title>Configuration</maml:title>
              <maml:para>Import this MP and use “Secure Reference Helper” tool … </maml:para>
            </maml:section>
          </MamlContent>
        </KnowledgeArticle>
      </KnowledgeArticles>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>
