Saturday, July 2, 2011

SCOM Discovery Managmentpack Example Using No Script

Below is just one example of 21,000 managementpacks written in xml on:

http://www.planetmps.com/


<ManagementPack xsi:noNamespaceSchemaLocation="C:\MPSchema\ManagementPackSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Manifest>
    <Identity>
      <ID>PlanetMPs.Win32_BIOS.Discovery</ID>
      <Version>1.0.0.1</Version>
    </Identity>
    <Name>PlanetMPs Win32_BIOS Discovery</Name>
    <References>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemHealth">
        <ID>System.Health.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemPerf">
        <ID>System.Performance.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SC">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="PlanetMPs.2009.Win32_BIOS" Abstract="false" Accessibility="Internal" Hosted="true" Base="Windows!Microsoft.Windows.LocalApplication">
          <Property ID="BiosCharacteristics" Type="string"/>
          <Property ID="BIOSVersion" Type="string"/>
          <Property ID="BuildNumber" Type="string"/>
          <Property ID="Caption" Type="string"/>
          <Property ID="CodeSet" Type="string"/>
          <Property ID="CurrentLanguage" Type="string"/>
          <Property ID="Description" Type="string"/>
          <Property ID="IdentificationCode" Type="string"/>
          <Property ID="InstallableLanguages" Type="string"/>
          <Property ID="InstallDate" Type="string"/>
          <Property ID="LanguageEdition" Type="string"/>
          <Property ID="ListOfLanguages" Type="string"/>
          <Property ID="Manufacturer" Type="string"/>
          <Property ID="Name" Type="string"/>
          <Property ID="OtherTargetOS" Type="string"/>
          <Property ID="PrimaryBIOS" Type="string"/>
          <Property ID="ReleaseDate" Type="string"/>
          <Property ID="SerialNumber" Type="string"/>
          <Property ID="SMBIOSBIOSVersion" Type="string"/>
          <Property ID="SMBIOSMajorVersion" Type="string"/>
          <Property ID="SMBIOSMinorVersion" Type="string"/>
          <Property ID="SMBIOSPresent" Type="string"/>
          <Property ID="SoftwareElementID" Type="string"/>
          <Property ID="SoftwareElementState" Type="string"/>
          <Property ID="Status" Type="string"/>
          <Property ID="TargetOperatingSystem" Type="string"/>
          <Property ID="Version" Type="string"/>
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="PlanetMPs.2009.Win32_BIOS.Discovery" Target="Windows!Microsoft.Windows.Server.Computer" Remotable="false" Enabled="true">
        <Category>Discovery</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="PlanetMPs.2009.Win32_BIOS">
            <Property PropertyID="BiosCharacteristics"/>
            <Property PropertyID="BIOSVersion"/>
            <Property PropertyID="BuildNumber"/>
            <Property PropertyID="Caption"/>
            <Property PropertyID="CodeSet"/>
            <Property PropertyID="CurrentLanguage"/>
            <Property PropertyID="Description"/>
            <Property PropertyID="IdentificationCode"/>
            <Property PropertyID="InstallableLanguages"/>
            <Property PropertyID="InstallDate"/>
            <Property PropertyID="LanguageEdition"/>
            <Property PropertyID="ListOfLanguages"/>
            <Property PropertyID="Manufacturer"/>
            <Property PropertyID="Name"/>
            <Property PropertyID="OtherTargetOS"/>
            <Property PropertyID="PrimaryBIOS"/>
            <Property PropertyID="ReleaseDate"/>
            <Property PropertyID="SerialNumber"/>
            <Property PropertyID="SMBIOSBIOSVersion"/>
            <Property PropertyID="SMBIOSMajorVersion"/>
            <Property PropertyID="SMBIOSMinorVersion"/>
            <Property PropertyID="SMBIOSPresent"/>
            <Property PropertyID="SoftwareElementID"/>
            <Property PropertyID="SoftwareElementState"/>
            <Property PropertyID="Status"/>
            <Property PropertyID="TargetOperatingSystem"/>
            <Property PropertyID="Version"/>
            <Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DiscoveryDataSource" RunAs="System!System.PrivilegedMonitoringAccount" TypeID="Windows!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
          <NameSpace>\\$Target/Property[Type="Windows!Microsoft.Windows.Computer"]/NetworkName$\root\CIMV2</NameSpace>
          <Query>SELECT * FROM Win32_BIOS</Query>
          <Frequency>60</Frequency>
          <ClassId>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]$</ClassId>
          <InstanceSettings>
            <Settings>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/BiosCharacteristics$</Name>
                 <Value>$Data/Property[@Name='BiosCharacteristics']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/BIOSVersion$</Name>
                 <Value>$Data/Property[@Name='BIOSVersion']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/BuildNumber$</Name>
                 <Value>$Data/Property[@Name='BuildNumber']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Caption$</Name>
                 <Value>$Data/Property[@Name='Caption']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/CodeSet$</Name>
                 <Value>$Data/Property[@Name='CodeSet']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/CurrentLanguage$</Name>
                 <Value>$Data/Property[@Name='CurrentLanguage']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Description$</Name>
                 <Value>$Data/Property[@Name='Description']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/IdentificationCode$</Name>
                 <Value>$Data/Property[@Name='IdentificationCode']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/InstallableLanguages$</Name>
                 <Value>$Data/Property[@Name='InstallableLanguages']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/InstallDate$</Name>
                 <Value>$Data/Property[@Name='InstallDate']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/LanguageEdition$</Name>
                 <Value>$Data/Property[@Name='LanguageEdition']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/ListOfLanguages$</Name>
                 <Value>$Data/Property[@Name='ListOfLanguages']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Manufacturer$</Name>
                 <Value>$Data/Property[@Name='Manufacturer']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Name$</Name>
                 <Value>$Data/Property[@Name='Name']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/OtherTargetOS$</Name>
                 <Value>$Data/Property[@Name='OtherTargetOS']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/PrimaryBIOS$</Name>
                 <Value>$Data/Property[@Name='PrimaryBIOS']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/ReleaseDate$</Name>
                 <Value>$Data/Property[@Name='ReleaseDate']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SerialNumber$</Name>
                 <Value>$Data/Property[@Name='SerialNumber']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SMBIOSBIOSVersion$</Name>
                 <Value>$Data/Property[@Name='SMBIOSBIOSVersion']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SMBIOSMajorVersion$</Name>
                 <Value>$Data/Property[@Name='SMBIOSMajorVersion']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SMBIOSMinorVersion$</Name>
                 <Value>$Data/Property[@Name='SMBIOSMinorVersion']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SMBIOSPresent$</Name>
                 <Value>$Data/Property[@Name='SMBIOSPresent']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SoftwareElementID$</Name>
                 <Value>$Data/Property[@Name='SoftwareElementID']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/SoftwareElementState$</Name>
                 <Value>$Data/Property[@Name='SoftwareElementState']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Status$</Name>
                 <Value>$Data/Property[@Name='Status']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/TargetOperatingSystem$</Name>
                 <Value>$Data/Property[@Name='TargetOperatingSystem']$</Value>
              </Setting>
              <Setting>
                 <Name>$MPElement[Name="PlanetMPs.2009.Win32_BIOS"]/Version$</Name>
                 <Value>$Data/Property[@Name='Version']$</Value>
              </Setting>
            </Settings>
          </InstanceSettings>
          <TimeoutSeconds>20</TimeoutSeconds>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <Presentation>
    <Views>
      <View ID="PlanetMPs.Win32_BIOS.Discovery.StateView" TypeID="SC!Microsoft.SystemCenter.StateViewType" Target="PlanetMPs.2009.Win32_BIOS" Visible="true" Accessibility="Internal">
        <Category>Operations</Category>
        <Criteria/>
      </View>
    </Views>
    <Folders>
      <Folder ID="PlanetMPs.Win32_BIOS.Discovery.ViewFolder.Root" ParentFolder="SC!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" Accessibility="Internal"/>
    </Folders>
    <FolderItems>
      <FolderItem ElementID="PlanetMPs.Win32_BIOS.Discovery.StateView" Folder="PlanetMPs.Win32_BIOS.Discovery.ViewFolder.Root"/>
    </FolderItems>
  </Presentation>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <!-- MP -->
        <DisplayString ElementID="PlanetMPs.Win32_BIOS.Discovery">
          <Name>PlanetMPs Win32_BIOS Discovery</Name>
          <Description>Discovers Win32_BIOS</Description>
        </DisplayString>
        <!-- Classes -->
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS">
          <Name>Win32_BIOS Discovery</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="BiosCharacteristics">
          <Name>BiosCharacteristics</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="BIOSVersion">
          <Name>BIOSVersion</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="BuildNumber">
          <Name>BuildNumber</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Caption">
          <Name>Caption</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="CodeSet">
          <Name>CodeSet</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="CurrentLanguage">
          <Name>CurrentLanguage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Description">
          <Name>Description</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="IdentificationCode">
          <Name>IdentificationCode</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="InstallableLanguages">
          <Name>InstallableLanguages</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="InstallDate">
          <Name>InstallDate</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="LanguageEdition">
          <Name>LanguageEdition</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="ListOfLanguages">
          <Name>ListOfLanguages</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Manufacturer">
          <Name>Manufacturer</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Name">
          <Name>Name</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="OtherTargetOS">
          <Name>OtherTargetOS</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="PrimaryBIOS">
          <Name>PrimaryBIOS</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="ReleaseDate">
          <Name>ReleaseDate</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SerialNumber">
          <Name>SerialNumber</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SMBIOSBIOSVersion">
          <Name>SMBIOSBIOSVersion</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SMBIOSMajorVersion">
          <Name>SMBIOSMajorVersion</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SMBIOSMinorVersion">
          <Name>SMBIOSMinorVersion</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SMBIOSPresent">
          <Name>SMBIOSPresent</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SoftwareElementID">
          <Name>SoftwareElementID</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="SoftwareElementState">
          <Name>SoftwareElementState</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Status">
          <Name>Status</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="TargetOperatingSystem">
          <Name>TargetOperatingSystem</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS" SubElementID="Version">
          <Name>Version</Name>
        </DisplayString>
        <!-- Discoveries -->
        <DisplayString ElementID="PlanetMPs.2009.Win32_BIOS.Discovery">
          <Name>Discovers Win32_BIOS</Name>
        </DisplayString>
        <!-- Views -->
        <DisplayString ElementID="PlanetMPs.Win32_BIOS.Discovery.StateView">
          <Name>State</Name>
        </DisplayString>
        <!-- Folders -->
        <DisplayString ElementID="PlanetMPs.Win32_BIOS.Discovery.ViewFolder.Root">
          <Name>Win32_BIOS</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>

SCOM Discovery Managmentpack Example Using JScript

I created over 21,000 managmentpacks in xml format that are located on:

http://www.planetmps.com/

You may have to do some tweeking.

<ManagementPack xsi:noNamespaceSchemaLocation="C:\MPSchema\ManagementPackSchema.xsd" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <Manifest>
    <Identity>
      <ID>PlanetMPs.Win32_Process.Discovery</ID>
      <Version>1.0.0.1</Version>
    </Identity>
    <Name>PlanetMPs Win32_Process Discovery</Name>
    <References>
      <Reference Alias="System">
        <ID>System.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemHealth">
        <ID>System.Health.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SystemPerf">
        <ID>System.Performance.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="Windows">
        <ID>Microsoft.Windows.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
      <Reference Alias="SC">
        <ID>Microsoft.SystemCenter.Library</ID>
        <Version>6.0.6246.0</Version>
        <PublicKeyToken>31bf3856ad364e35</PublicKeyToken>
      </Reference>
    </References>
  </Manifest>
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="PlanetMPs.2009.Win32_Process" Abstract="false" Accessibility="Internal" Hosted="true" Base="Windows!Microsoft.Windows.LocalApplication">
          <Property ID="Caption" Type="string"/>
          <Property ID="CommandLine" Type="string"/>
          <Property ID="CreationClassName" Type="string"/>
          <Property ID="CreationDate" Type="string"/>
          <Property ID="CSCreationClassName" Type="string"/>
          <Property ID="CSName" Type="string"/>
          <Property ID="Description" Type="string"/>
          <Property ID="ExecutablePath" Type="string"/>
          <Property ID="ExecutionState" Type="string"/>
          <Property ID="Handle" Type="string"/>
          <Property ID="HandleCount" Type="string"/>
          <Property ID="InstallDate" Type="string"/>
          <Property ID="KernelModeTime" Type="string"/>
          <Property ID="MaximumWorkingSetSize" Type="string"/>
          <Property ID="MinimumWorkingSetSize" Type="string"/>
          <Property ID="Name" Type="string"/>
          <Property ID="OSCreationClassName" Type="string"/>
          <Property ID="OSName" Type="string"/>
          <Property ID="OtherOperationCount" Type="string"/>
          <Property ID="OtherTransferCount" Type="string"/>
          <Property ID="PageFaults" Type="string"/>
          <Property ID="PageFileUsage" Type="string"/>
          <Property ID="ParentProcessId" Type="string"/>
          <Property ID="PeakPageFileUsage" Type="string"/>
          <Property ID="PeakVirtualSize" Type="string"/>
          <Property ID="PeakWorkingSetSize" Type="string"/>
          <Property ID="Priority" Type="string"/>
          <Property ID="PrivatePageCount" Type="string"/>
          <Property ID="ProcessId" Type="string"/>
          <Property ID="QuotaNonPagedPoolUsage" Type="string"/>
          <Property ID="QuotaPagedPoolUsage" Type="string"/>
          <Property ID="QuotaPeakNonPagedPoolUsage" Type="string"/>
          <Property ID="QuotaPeakPagedPoolUsage" Type="string"/>
          <Property ID="ReadOperationCount" Type="string"/>
          <Property ID="ReadTransferCount" Type="string"/>
          <Property ID="SessionId" Type="string"/>
          <Property ID="Status" Type="string"/>
          <Property ID="TerminationDate" Type="string"/>
          <Property ID="ThreadCount" Type="string"/>
          <Property ID="UserModeTime" Type="string"/>
          <Property ID="VirtualSize" Type="string"/>
          <Property ID="WindowsVersion" Type="string"/>
          <Property ID="WorkingSetSize" Type="string"/>
          <Property ID="WriteOperationCount" Type="string"/>
          <Property ID="WriteTransferCount" Type="string"/>
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <Monitoring>
    <Discoveries>
      <Discovery ID="PlanetMPs.2009.Win32_Process.Discovery" Target="Windows!Microsoft.Windows.Server.Computer" Remotable="false" Enabled="true">
        <Category>Discovery</Category>
        <DiscoveryTypes>
          <DiscoveryClass TypeID="PlanetMPs.2009.Win32_Process">
            <Property PropertyID="Caption"/>
            <Property PropertyID="CommandLine"/>
            <Property PropertyID="CreationClassName"/>
            <Property PropertyID="CreationDate"/>
            <Property PropertyID="CSCreationClassName"/>
            <Property PropertyID="CSName"/>
            <Property PropertyID="Description"/>
            <Property PropertyID="ExecutablePath"/>
            <Property PropertyID="ExecutionState"/>
            <Property PropertyID="Handle"/>
            <Property PropertyID="HandleCount"/>
            <Property PropertyID="InstallDate"/>
            <Property PropertyID="KernelModeTime"/>
            <Property PropertyID="MaximumWorkingSetSize"/>
            <Property PropertyID="MinimumWorkingSetSize"/>
            <Property PropertyID="Name"/>
            <Property PropertyID="OSCreationClassName"/>
            <Property PropertyID="OSName"/>
            <Property PropertyID="OtherOperationCount"/>
            <Property PropertyID="OtherTransferCount"/>
            <Property PropertyID="PageFaults"/>
            <Property PropertyID="PageFileUsage"/>
            <Property PropertyID="ParentProcessId"/>
            <Property PropertyID="PeakPageFileUsage"/>
            <Property PropertyID="PeakVirtualSize"/>
            <Property PropertyID="PeakWorkingSetSize"/>
            <Property PropertyID="Priority"/>
            <Property PropertyID="PrivatePageCount"/>
            <Property PropertyID="ProcessId"/>
            <Property PropertyID="QuotaNonPagedPoolUsage"/>
            <Property PropertyID="QuotaPagedPoolUsage"/>
            <Property PropertyID="QuotaPeakNonPagedPoolUsage"/>
            <Property PropertyID="QuotaPeakPagedPoolUsage"/>
            <Property PropertyID="ReadOperationCount"/>
            <Property PropertyID="ReadTransferCount"/>
            <Property PropertyID="SessionId"/>
            <Property PropertyID="Status"/>
            <Property PropertyID="TerminationDate"/>
            <Property PropertyID="ThreadCount"/>
            <Property PropertyID="UserModeTime"/>
            <Property PropertyID="VirtualSize"/>
            <Property PropertyID="WindowsVersion"/>
            <Property PropertyID="WorkingSetSize"/>
            <Property PropertyID="WriteOperationCount"/>
            <Property PropertyID="WriteTransferCount"/>
            <Property TypeID="System!System.Entity" PropertyID="DisplayName"/>
          </DiscoveryClass>
        </DiscoveryTypes>
        <DataSource ID="DS" TypeID="Windows!Microsoft.Windows.TimedScript.DiscoveryProvider">
        <IntervalSeconds>5</IntervalSeconds>
        <SyncTime/>
        <ScriptName>Win32_Process.js</ScriptName>
        <Arguments>$MPElement$ $Target/Id$ $Target/Property[Type="Windows!Microsoft.Windows.Computer"]/PrincipalName$</Arguments>
        <ScriptBody>
        <![CDATA[
       
        var oArgs = WScript.Arguments;
        if (oArgs.length != 3)
        {
            WScript.Quit(-1);
        }
        var SourceID = oArgs(0);
        var ManagedEntityId = oArgs(1);
        var TargetComputer = oArgs(2);
        var oAPI = new ActiveXObject("MOM.ScriptAPI");
        var oDiscoveryData = oAPI.CreateDiscoveryData(0, SourceID, ManagedEntityId);
        var oInst = oDiscoveryData.CreateClassInstance("$MPElement[Name='PlanetMPs.2009.Win32_Process']$");
        oInst.AddProperty("$MPElement[Name='Windows!Microsoft.Windows.Computer']/PrincipalName$", TargetComputer);
        var l = new ActiveXObject("WbemScripting.SWbemLocator");
        var svc = l.ConnectServer(TargetComputer, "root\\CIMV2");
        var objs = svc.InstancesOf("Win32_Process");
       
        var enumItems = new Enumerator(objs);
        for (; !enumItems.atEnd(); enumItems.moveNext())
        {
              var obj = enumItems.item();
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Caption$", GetValue("Caption", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/CommandLine$", GetValue("CommandLine", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/CreationClassName$", GetValue("CreationClassName", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/CreationDate$", GetValue("CreationDate", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/CSCreationClassName$", GetValue("CSCreationClassName", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/CSName$", GetValue("CSName", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Description$", GetValue("Description", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ExecutablePath$", GetValue("ExecutablePath", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ExecutionState$", GetValue("ExecutionState", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Handle$", GetValue("Handle", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/HandleCount$", GetValue("HandleCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/InstallDate$", GetValue("InstallDate", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/KernelModeTime$", GetValue("KernelModeTime", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/MaximumWorkingSetSize$", GetValue("MaximumWorkingSetSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/MinimumWorkingSetSize$", GetValue("MinimumWorkingSetSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Name$", GetValue("Name", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/OSCreationClassName$", GetValue("OSCreationClassName", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/OSName$", GetValue("OSName", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/OtherOperationCount$", GetValue("OtherOperationCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/OtherTransferCount$", GetValue("OtherTransferCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PageFaults$", GetValue("PageFaults", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PageFileUsage$", GetValue("PageFileUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ParentProcessId$", GetValue("ParentProcessId", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PeakPageFileUsage$", GetValue("PeakPageFileUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PeakVirtualSize$", GetValue("PeakVirtualSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PeakWorkingSetSize$", GetValue("PeakWorkingSetSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Priority$", GetValue("Priority", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/PrivatePageCount$", GetValue("PrivatePageCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ProcessId$", GetValue("ProcessId", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/QuotaNonPagedPoolUsage$", GetValue("QuotaNonPagedPoolUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/QuotaPagedPoolUsage$", GetValue("QuotaPagedPoolUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/QuotaPeakNonPagedPoolUsage$", GetValue("QuotaPeakNonPagedPoolUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/QuotaPeakPagedPoolUsage$", GetValue("QuotaPeakPagedPoolUsage", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ReadOperationCount$", GetValue("ReadOperationCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ReadTransferCount$", GetValue("ReadTransferCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/SessionId$", GetValue("SessionId", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/Status$", GetValue("Status", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/TerminationDate$", GetValue("TerminationDate", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/ThreadCount$", GetValue("ThreadCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/UserModeTime$", GetValue("UserModeTime", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/VirtualSize$", GetValue("VirtualSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/WindowsVersion$", GetValue("WindowsVersion", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/WorkingSetSize$", GetValue("WorkingSetSize", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/WriteOperationCount$", GetValue("WriteOperationCount", obj));
          oInst.AddProperty("$MPElement[Name='PlanetMPs.2009.Win32_Process']/WriteTransferCount$", GetValue("WriteTransferCount", obj));
        break;
        }
        function GetValue(Name, obj)
        {
              var tempstr = new String();
              var tempstr1 = new String();
              var tName = new String();
              tempstr1 = obj.GetObjectText_();
              var re = /"/g;
              tempstr1 = tempstr1.replace(re , "");
              var pos;
              tName = Name + " = ";
              pos = tempstr1.indexOf(tName);
              if (pos > -1)
              {
                 pos = pos + tName.length;
                 tempstr = tempstr1.substring(pos, tempstr1.length);
                 pos = tempstr.indexOf(";");
                 tempstr = tempstr.substring(0, pos);
                 tempstr = tempstr.replace("{", "");
                 tempstr = tempstr.replace("}", "");
                 if (tempstr.length > 13)
                 {
                    if (obj.Properties_(Name).CIMType == 101)
                    {
                       tempstr = tempstr.substr(4, 2) + "/"  + tempstr.substr(6, 2) + "/" + tempstr.substr(0, 3) + " " + tempstr.substr(8, 2) + ":" + tempstr.substr(10, 2) + ":" + tempstr.substr(12, 2);
                    }
                 }
                 return tempstr;
              }
              else
              {
                 return "";
              }
           }
        ]]>
        </ScriptBody>
          <TimeoutSeconds>20</TimeoutSeconds>
        </DataSource>
      </Discovery>
    </Discoveries>
  </Monitoring>
  <Presentation>
    <Views>
      <View ID="PlanetMPs.Win32_Process.Discovery.StateView" TypeID="SC!Microsoft.SystemCenter.StateViewType" Target="PlanetMPs.2009.Win32_Process" Visible="true" Accessibility="Internal">
        <Category>Operations</Category>
        <Criteria/>
      </View>
    </Views>
    <Folders>
      <Folder ID="PlanetMPs.Win32_Process.Discovery.ViewFolder.Root" ParentFolder="SC!Microsoft.SystemCenter.Monitoring.ViewFolder.Root" Accessibility="Internal"/>
    </Folders>
    <FolderItems>
      <FolderItem ElementID="PlanetMPs.Win32_Process.Discovery.StateView" Folder="PlanetMPs.Win32_Process.Discovery.ViewFolder.Root"/>
    </FolderItems>
  </Presentation>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <!-- MP -->
        <DisplayString ElementID="PlanetMPs.Win32_Process.Discovery">
          <Name>PlanetMPs Win32_Process Discovery</Name>
          <Description>Discovers Win32_Process</Description>
        </DisplayString>
        <!-- Classes -->
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process">
          <Name>Win32_Process Discovery</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Caption">
          <Name>Caption</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="CommandLine">
          <Name>CommandLine</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="CreationClassName">
          <Name>CreationClassName</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="CreationDate">
          <Name>CreationDate</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="CSCreationClassName">
          <Name>CSCreationClassName</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="CSName">
          <Name>CSName</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Description">
          <Name>Description</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ExecutablePath">
          <Name>ExecutablePath</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ExecutionState">
          <Name>ExecutionState</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Handle">
          <Name>Handle</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="HandleCount">
          <Name>HandleCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="InstallDate">
          <Name>InstallDate</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="KernelModeTime">
          <Name>KernelModeTime</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="MaximumWorkingSetSize">
          <Name>MaximumWorkingSetSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="MinimumWorkingSetSize">
          <Name>MinimumWorkingSetSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Name">
          <Name>Name</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="OSCreationClassName">
          <Name>OSCreationClassName</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="OSName">
          <Name>OSName</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="OtherOperationCount">
          <Name>OtherOperationCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="OtherTransferCount">
          <Name>OtherTransferCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PageFaults">
          <Name>PageFaults</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PageFileUsage">
          <Name>PageFileUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ParentProcessId">
          <Name>ParentProcessId</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PeakPageFileUsage">
          <Name>PeakPageFileUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PeakVirtualSize">
          <Name>PeakVirtualSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PeakWorkingSetSize">
          <Name>PeakWorkingSetSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Priority">
          <Name>Priority</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="PrivatePageCount">
          <Name>PrivatePageCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ProcessId">
          <Name>ProcessId</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="QuotaNonPagedPoolUsage">
          <Name>QuotaNonPagedPoolUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="QuotaPagedPoolUsage">
          <Name>QuotaPagedPoolUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="QuotaPeakNonPagedPoolUsage">
          <Name>QuotaPeakNonPagedPoolUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="QuotaPeakPagedPoolUsage">
          <Name>QuotaPeakPagedPoolUsage</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ReadOperationCount">
          <Name>ReadOperationCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ReadTransferCount">
          <Name>ReadTransferCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="SessionId">
          <Name>SessionId</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="Status">
          <Name>Status</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="TerminationDate">
          <Name>TerminationDate</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="ThreadCount">
          <Name>ThreadCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="UserModeTime">
          <Name>UserModeTime</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="VirtualSize">
          <Name>VirtualSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="WindowsVersion">
          <Name>WindowsVersion</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="WorkingSetSize">
          <Name>WorkingSetSize</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="WriteOperationCount">
          <Name>WriteOperationCount</Name>
        </DisplayString>
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process" SubElementID="WriteTransferCount">
          <Name>WriteTransferCount</Name>
        </DisplayString>
        <!-- Discoveries -->
        <DisplayString ElementID="PlanetMPs.2009.Win32_Process.Discovery">
          <Name>Discovers Win32_Process</Name>
        </DisplayString>
        <!-- Views -->
        <DisplayString ElementID="PlanetMPs.Win32_Process.Discovery.StateView">
          <Name>State</Name>
        </DisplayString>
        <!-- Folders -->
        <DisplayString ElementID="PlanetMPs.Win32_Process.Discovery.ViewFolder.Root">
          <Name>Win32_Process</Name>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPack>