A while back I got a request from one of my Application Team to monitor multiple services on a set of servers. Usually the standard way of completing this request would be to create a group of servers on which the service is monitoring and create individual service monitor for each service, however this request was a little unique.
All the services that were given me to monitor had a similar prefix "Hyper-V" and then the service name for eg "Hyper-VService1", "Hyper-VService2" etc.
Hence, I thought if there is way to monitor multiple services using WildCard which would greatly reduce the time to create the monitoring configuration and SCOM Admins their time back.
Let's dive right into it.
- The First step would be same as always create a group of servers for which monitoring needs to be enabled.
- If you already have a group where these services needs to be monitored create the service in the same Management Pack.
- For this blog I will be creating a New Group and saving the config in a New Management Pack.

- Add the servers explicitly or dynamically as per your requirement and save the group.
- Now create a test service that needs to be monitored on this server, you may use any service as we will be changing the config from the Management Pack. I am using Spooler.
- Now comes the fun part. Open Wbemtest on one of the server where service needs to be monitored.
- Connect to root\cimv2 and Select Query.

- Write the following Query "select * from win32_service where (DisplayName like '%Hyper-V%')"
- This query will return the list of services Running with DisplayName Hyper-V.
- What we did here is used WildCard to identify list of services that are running with the DisplayName Hyper-V and the same will be applied in our Management Pack.
MP Authoring Section.
- Now to the MP Part to SCOM Administration > Management Packs > Select the Management pack where the service monitor was created > Export Management Pack.
- Open the Management Pack in any editor for your choice and look for the following highlighted section.
=========================================================================
<Discoveries>
<Discovery ID="UINameSpacea93b21e7cf554ddd91465e5f8d7a93fc.Group.DiscoveryRule" Enabled="true" Target="UINameSpacea93b21e7cf554ddd91465e5f8d7a93fc.Group" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryRelationship TypeID="MicrosoftSystemCenterInstanceGroupLibrary7585010!Microsoft.SystemCenter.InstanceGroupContainsEntities" />
</DiscoveryTypes>
<DataSource ID="GroupPopulationDataSource" TypeID="SystemCenter!Microsoft.SystemCenter.GroupPopulator">
<RuleId>$MPElement$</RuleId>
<GroupInstanceId>$MPElement[Name="UINameSpacea93b21e7cf554ddd91465e5f8d7a93fc.Group"]$</GroupInstanceId>
<MembershipRules>
<MembershipRule>
<MonitoringClass>$MPElement[Name="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Server.Computer"]$</MonitoringClass>
<RelationshipClass>$MPElement[Name="MicrosoftSystemCenterInstanceGroupLibrary7585010!Microsoft.SystemCenter.InstanceGroupContainsEntities"]$</RelationshipClass>
<IncludeList>
<MonitoringObjectId>09057974-5012-07b5-54a5-89183a595c8e</MonitoringObjectId>
</IncludeList>
</MembershipRule>
</MembershipRules>
</DataSource>
</Discovery>
<Discovery ID="ServiceStateProbePage_fcd1ed2a65c844d1bd0f7537a7919737.DiscoveryRule" Enabled="false" Target="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal">
<Category>Discovery</Category>
<DiscoveryTypes>
<DiscoveryClass TypeID="ServiceStateProbePage_fcd1ed2a65c844d1bd0f7537a7919737" />
</DiscoveryTypes>
<DataSource ID="DS" TypeID="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Win32ServiceInformationProviderWithClassSnapshotDataMapper">
<ComputerName>$Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<ServiceName>Spooler</ServiceName>
<Frequency>60</Frequency>
<ClassId>$MPElement[Name="ServiceStateProbePage_fcd1ed2a65c844d1bd0f7537a7919737"]$</ClassId>
<InstanceSettings>
<Settings>
<Setting>
<Name>$MPElement[Name="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/PrincipalName$</Name>
<Value>$Target/Property[Type="MicrosoftWindowsLibrary7585010!Microsoft.Windows.Computer"]/PrincipalName$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/ServiceName$</Name>
<Value>$Data/Property[@Name='Name']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/ServiceProcessName$</Name>
<Value>$Data/Property[@Name='BinaryPathName']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/DisplayName$</Name>
<Value>$Data/Property[@Name='DisplayName']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="MicrosoftSystemCenterNTServiceLibrary!Microsoft.SystemCenter.NTService"]/Description$</Name>
<Value>$Data/Property[@Name='Description']$</Value>
</Setting>
<Setting>
<Name>$MPElement[Name="System!System.Entity"]/DisplayName$</Name>
<Value>SCOM Wildcard Service</Value>
</Setting>
</Settings>
</InstanceSettings>
</DataSource>
</Discovery>
</Discoveries>
=========================================================================
- Now update the first section highlighted in Yellow.
<DataSource ID="DS" TypeID="MicrosoftWindowsLibrary7585010!Microsoft.Windows.WmiProviderWithClassSnapshotDataMapper">
<NameSpace>root\cimv2</NameSpace>
<Query>select * from win32_service where (DisplayName like '%Hyper-V%')</Query>
<Frequency>60</Frequency>
<ClassId>$MPElement[Name="ServiceStateProbePage_fcd1ed2a65c844d1bd0f7537a7919737"]$</ClassId>
- Change ComputerName to NameSpace and Frequency to Query.
- Now change the Purple highlighted section from BinaryPathName to PathName
- Next update the Green Highligted Section to the following value - $Data/Property[@Name=’Name’]$
- Now save the updates and change the Management Pack Version to an updated version from 1.0.0.0 to 1.0.0.1.

- Import the updated Management Pack.
- Now move to Discovered inventory and you would start seeing the Hyper-V Services coming up.
- This way with just one monitor we are monitoring a set of services, AMAZING AIN'T IT.
- You might see sometime before the config is applied and monitors are populated.
Please let me know your thoughts over this blog.