Tag Archives: MimboloveSCOM

OpsLogix VMware Management Pack Quick Overview

Written by Tao Yang

Recently, I have had chance to evaluate the OpsLogix VMware management pack. In this post, I will discuss my experience with this MP so far.

Setup and Configuration

Once the MP files are imported , you will be able to import the license from the licensing dashboard in the monitoring pane under the OpsLogix folder.


Once the license is imported, you can manually add the VMware vCenter server from the “VMWare IMP COnfiguration dashboard” located under OpsLogix\VMware folder:


I have create a service account in AD and give it admin rights in vCenter. I used this account to connect to vCenter on this dashboard.

Note: Please do not use an account with administrative privilege in your production environment. a normal user with top level read-only access will suffice.


The OpsLogix VMware MP also has defined a resource pool that you can use for monitoring vCenter:


By default, the resource pool membership is set Automatic (which means all management servers are a member of). you can change it to Manual membership and hand pick the management servers you want to be a member of this resource pool.

Alternatively, you can also pick another existing resource pool (or even create your own) in the OpsLogix VMware configuration dashboard. You can also use resource pools containing OpsMgr gateway servers to monitor your VMware environment.

Discovered Objects

This MP discovers and monitors the following components:

  • vCenter servers
  • Datacenters
  • Clusters
  • Datastores
  • ESX hosts
  • Virtual Machines
  • VM Networks
  • Various hardware components

Here’s the sample diagram view from my lab environment:


The MP ships with a top level Alert view for all alerts generated by the MP:


The MP collects data and queries the health state of the VMware components via the vCenter Managed Object Browser (MOB). I was impressed about how many performance counters are being collected by the MP. It also comes with a performance dashboard which you can view from the OpsMgr console:


I have been asked many times before that what exactly does this MP monitor / collect? To answer the question, I’ve used MPViewer and exported all the monitoring MPs to Excel and make this SpreadSheet that contains all the rules and unit monitors.

This MP does not require any additional servers to monitor the VMware infrastructure as it leverages a resource pool to query vCenter. In my lab environment, since I have installed vCenter server on a Windows server, I also installed the OpsMgr agent on the vCenter server, so the server itself is monitored by OpsMgr.

Hardware Monitoring

As mentioned previously, this MP also monitors the hardware components in your VMware environments. In particular, the following components are discovered and monitored:

  • Battery
  • Fan
  • Memory
  • Network cards
  • Power Supply
  • Processor
  • Storage
  • Temperature
  • Voltage

This covers all the essential fabric components (Compute, Network and Storage), as well as the other hardware components such as PSU, battery, and physical environments such as temperature and voltage. the screenshots below are some sample state views taken from a demo environment:








The reporting MP provides several availability reports for different VMware components:


i.e. ESX host availability report:


I’ve created a sample ESX host availability report, you can download it from HERE.

Note: all the reports shipped in this MP are linked reports, So if they don’t meet your requirements, you can always use other  existing reports in your management group (i.e. the performance reports from Microsoft Generic Report Library).

Squared Up Dashboard

I have created a Squared Up dashboard for this the OpsLogix VMware MP.

OpsLogix VMware Dashboard

If you are also Squared Up in your OpsMgr environment, you can download this dashboard and import this dashboard from Squared Up’s community site: https://community.squaredup.com/browse/download-info/opslogix-vmware/


If you’d like to know more about this MP, you can find the datasheet here: http://www.opslogix.com/wp-content/uploads/2014/08/VMware-MP-Datasheet-2016.pdf and the whitepaper here: http://www.opslogix.com/wp-content/uploads/2016/01/VMware-MP-White-Paper-2016.pdf

Automating OpsLogix Oracle MP Configuration

Written by Tao Yang


One of the flagship management packs from OpsLogix is the Oracle Database MP. This MP provides several GUI driven wizard to help you creating your own monitoring solutions for Oracle by leveraging the OpsMgr management pack templates (https://technet.microsoft.com/en-au/library/hh457614.aspx). At this stage, the OpsLogix Oracle MP provides the following templates:

01. Oracle Alert Rule template

This template allows you to create a rule that checks a value from your oracle environment and generate alerts in the event that the value is detected or missing, depending on the configuration you have specified.

02. Oracle Performance Collection Rule template

This template allows you to create a rule that will collect performance data from your Oracle environment in order to visualize data on the performance view and reports.

03. Oracle Two-State Monitor Template

This template allows you to create a monitor that will check the health of an element according to the configuration that you have specified in the wizard. It will generate alerts when the monitor becomes unhealthy.

Like any other OpsMgr management pack templates, the above mentioned templates can be found in the Authoring pane of the OpsMgr console, under “Management Pack Templates”:


Some Background on Management Pack Templates

The MP templates provide great ways for users to create complex monitoring scenarios without having to use MP authoring tools such as VSAE or Silect MPAuthor. The MP templates are designed to satisfy specific monitoring needs (i.e. Windows service monitoring, TCP Port monitoring etc.). From an OpsMgr admin and operator point of view, they are great, because each template provides a user friendly GUI driven wizard for you to create your monitoring solutions.

From a MP developer point of view, these templates are not easy to create – not only because you need to define the templates in the MP, but most of time, you also need to design the UI pages to be used in the wizard, which is very time consuming (not to mention these UI pages are written in C#). I have done it several times, and believe me, they are not easy! So every time when I see a MP offers management pack templates, I really appreciate the effort put in by the developers.

Although I think the management pack templates provides a user friendly GUI driven wizard for users to create their monitoring solutions, in my opinion, the biggest drawback is also the GUI wizard. It means you HAVE TO use the GUI wizard – it may become an issue when you have a lot of stuff to configure.

Let me give you an example based on my own experience. A few months ago, I was away attending a conference overseas and a customer needed to create hundreds of instances for the Windows Service monitoring template. Because they didn’t want to wait for my return, I was told someone spent a few days clicking through the wizard many, many times.

So what other options do we have? Fortunately, the management pack template instances can be created via OpsMgr SDK.

Automating MP Template Instance Creation

If you have been following my blog series “Automating OpsMgr”, you may have already read Part 17 of this series: Creating Windows Service Management Pack Template Instance, where I demonstrated a runbook leveraging the OpsMgrExtended PowerShell module and enabled people to create a management pack template instance (in this case, the Windows Service template) using one line of PowerShell script. This was a great example on how to create the template instances in mass scales.

OK, let’s go back to the OpsLogix Oracle MP… Just to put it out there, my experience with Oracle DB is very limited. Throughout the years I spent in IT, I’ve only been dealing with Microsoft’s SQL servers. Based on my experience with SQL, I know that every DBA will have a set of queries they regularly use to monitor their SQL environments. I assume this is also the case for Oracle. So, one of the first concerns I had when I started playing with this MP is, creating user defined monitoring scenarios could be very time consuming when using the management pack template wizards. Therefore, I spent few hours today, and produced 3 separate PowerShell functions that people can use to create instances for the 3 templates mentioned above. These functions are:

  1. New-OpsLogixOracleAlertTemplateInstance
  2. New-OpsLogixOraclePerfTemplateInstance
  3. New-OpsLogixOracle2StateMonitorTemplateInstance


These functions requires the OpsMgrExtended Module on the computer where you are running the script. Please follow the instruction and setup this module first.

Download Link:

I have uploaded the code for above mentioned PowerShell functions to Github. You can download them from https://github.com/tyconsulting/OpsMgr-SDK-Scripts/tree/master/OpsLogix%20Oracle%20MP%20Scripts

Now, let’s test them, I will use the –verbose switch when calling these functions so you can see the verbose messages.

01. Creating a test MP

Firstly, I’ll create a test MP using the New-OMManagementPack command from the OpsMgrExtended module:


02. Create an instance for the alert rule template (using PowerShell Splatting)

Calling the New-OpsLogixOracleAlertTemplateInstance function:



03. Create an instance for the performance collection template

Calling the New-OpsLogixOraclePerfTemplateInstance function:



04. Create an instance for the Two-State Monitor template

Calling the New-OpsLogixOracle2StateMonitorTemplateInstance function:



Note: There is also a test.ps1 script in this Github repository. It contains the test parameters used as shown in the screenshots above.


As you may have noticed, these functions also have a parameter set to support the SMA / Azure Automation connection object (defined in the OpsMgrExtended Module). If you are planning to make this part of your automation solution, you can simply change this from a PowerShell function to a runbook and use the –SDKConnection parameter to establish connection to the management group. this should be very straightforward; you can refer to my previous post on the Automating OpsMgr blog series for more details.

I hope these functions will help customers who are deploying Oracle monitoring solutions using OpsLogix Oracle MP. For example, if you need to create a lot of these instances, you can create a CSV file with all the required parameters and values, and then create a very simple PowerShell script to read the CSV file and then call the appropriate functions. I’ve done the hard work for you, the rest should be pretty easy  Smile.

Lastly, if anyone would like to evaluate the OpsLogix Oracle MP, they can be contacted via email sales@opslogix.com

Capacity Planning – OMS Vs. OpsLogix Capacity Reports MP

Written by Tao Yang


When it comes to data center / fabric capacity planning, currently there are 2 major solutions within Microsoft’s System Center and OMS space. These solutions are:

In this post, I will discuss the differences and similarities between these 2 solutions

OMS Capacity Planning Solution Overview

The OMS Capacity Planning solution was designed to provide an overview on the current and future utilisation of your virtualisation infrastructure and fabric. It is freely available for all OMS customers (well, you do have to pay for the OMS data consumption).

It collects a set of performance data via OpsMgr, and forecast your resource utilization based on the performance data collected.

If you have not used the OMS Capacity Planning solution yet and would like to learn more, here is a list of great resources for you:

To date, out of all the solutions that OMS provides, the Capacity Planning Solution is probably the one that has the most complex requirements. It requires:

  1. Hyper-V hosts managed by VMM
  2. VMM fully integrated with OpsMgr (configured via VMM console)
  3. OpsMgr connected to OMS Workspace
  4. VMM Management Servers and Hyper-V hosts onboarded to OMS via OpsMgr

Because of the nature of this solution, it collects a specific set of performance counters on VMM and Hyper-V servers to forecast the compute and storage fabric within your virtualisation infrastructure. It does not work for Other types of hypervisors that are being managed by VMM (i.e. VMware).

It provides some charts and diagrams which gives you a high level overview of your fabric.





You can also access the performance data collected by this solution via Search (Type=Perf)


OpsLogix Capacity Report MP Overview

Unlike OMS Capacity Planning solution, the OpsLogix Capacity Report MP is not a hybrid solution. It does not require integrations with any products. Once you have imported the Capacity Report MP and the license MP, you should soon see the number of reports deployed in your OpsMgr management group.


As the names suggest, with the two absolute value reports, you can pick any performance collection rules for the language that you have selected (default to “English”).


and the report lists each instance you have selected.


The 2 columns on the left shows the forecasted changes and the forecasted value for each instance based on the time frame you have selected.

The percentage value reports are designed for the performance collection rules that are collecting percentage values. You can also specify warning and critical thresholds (in number of days) for the forecasted data.


Or, if you only want to see the critical ones, you can use “Critical Only” reports.



Although both solutions provide forecasting capabilities for your infrastructure managed by OpsMgr, it serves different purposes.

OMS Capacity Planning solution collects a specific set of performance counters around the compute and storage fabric, and provides a high level view on what is the current and future capacity for the fabric in your Hyper-V environment. If you want to take a look at what counters are being collected by the Capacity Planning solution, you can export the following MPs from your OpsMgr management group and take a look using MPViewer.


The OpsLogix Capacity Report MP provides a set of generic reports that can be used to forecast pretty much any existing counters that are being currently collected in your OpsMgr environment. This is purely a reporting MP, it does not collect any performance counters by itself.

Since the performance data collected by the OMS Capacity Planning solution is being saved only at your OMS workspace, you will not see these performance collection rules from the drop down lists in the OpsLogix capacity reports because they are not available in your OpsMgr Data Warehouse DB.

Although I have not personally tried it, theoretically, you can use the OpsLogix capacity report MP to produce forecasting reports for your Hyper-V environments (just like what the OMS Capacity Planning does), as long as you have configured OpsMgr to collect the same counters. Additionally, if you are using other hypervisors such as VMware and they are being monitored by OpsMgr, you can also use the OpsLogix capacity report MP for forecasting your fabric resource utilisation – this is something the OMS Capacity Planning solution does not provide.


I hope I have provided a high level overview and comparison between OMS Capacity Planning solution and OpsLogix Capacity Report MP in this post. If you have questions or feedback, please feel free to contact me.

Extending Your OpsMgr Power BI Dashboards to Power BI Sites

Written by Tao Yang


Few days ago, my friend and CDM MVP Cameron Fuller published a great article on how to build Power BI Dashboards for OpsMgr. You can check out Cameron’s post from here: http://blogs.catapultsystems.com/cfuller/archive/2015/12/01/using-power-bi-for-disk-space-dashboards-and-reports-in-operations-manager/

The solution Cameron produced was based on Power BI desktop and OpsMgr Data Warehouse DB, which both are located in your on-premises network. After Cameron has shown us what he has produced, I spent some time, and managed to extend the reports and dashboards that Cameron has created using Power BI Desktop to Power BI sites, which is a cloud-based PaaS solution offered as a part of the Office 365.

In this post, I will go through the process of setting up this solution so you can move Cameron’s Power BI dashboard to the cloud.


In order to create a Power BI dataset in your cloud based Power BI sites which is based on the on-prem OpsMgr Data Warehouse DB, we will need to install a component called Power BI Enterprise Gateway (Currently in preview) on a server in your on-prem data center. As shown in the diagram below, once the dataset is created for the OpsMgr Data Warehouse DB, the Power BI Site will query the OpsMgr DW DB through the Power BI Enterprise Gateway.

PowerBI OpsMgr Dashboard Connection


The solution we are going to implement requires the following pre-requisites:

  • A on-prem server for hosting the Power BI Enterprise Gateway
  • Power BI Desktop installed on an on-prem computer (i.e. your own PC)
  • A Power BI Pro account
  • A service account that has access to the OpsMgr data warehouse DB


Power BI Enterprise Gateway is a feature only available for Power BI Pro accounts. Please refer to this page for differences between Power BI Free and Pro accounts.


The install process for the Power BI Enterprise Gateway is very straightforward. It is documented here: https://powerbi.microsoft.com/en-us/documentation/powerbi-gateway-enterprise/

Once it is installed and connected to your Power BI account, you will be able to manage the gateway after you’ve logged on to the Power BI Site (https://app.powerbi.com/):


And you can use “Add Data Source” to establish connection to a data base via the gateway:


I have created a data source for my OpsMgr DW DB:


After the data source is created for the OpsMgr DW DB, I then need to create a dataset based on the OpsMgr DW DB. We must create this dataset in Power BI Desktop.

As Cameron already demonstrated in his post, in Power BI Desktop, we create a new document, and select SQL Server Database:


We then specify the SQL server name and database name for the OpsMgr DW DB:



Please make sure the server name and database name entered here is IDENTICAL as what you have entered for the OpsMgr DW DB Data Source you have created under the Power BI Enterprise Gateway.

Then, we will select all the tables and views that we are interested in. I won’t repeat what Cameron has already demonstrated, Please refer to his post for more details on what tables and views to select.

Please make sure you have select ALL the tables and views that you need. Once we have uploaded this configuration to Power BI Site, we won’t be able to modify this dataset in Power BI Site.

Once we have selected all required tables and views, click “Load”:


Please make sure you choose “DirectQuery” when prompted:


Power BI will then create the connections to each table and view you have selected. Depending on the number of tables and views you have selected, this process may take a while:


You can now see all the tables and views you have selected in Power BI Desktop:


Now, we can save this empty Power BI report:


After it is saved, we can go back to the Power BI Site, and import the newly created report by clicking “Get Data”:


Then choose “Files:


Select Local File, and choose the empty report we’ve just created in Power BI Desktop


Then, you should be able to the new dataset appeared under “Datasets”:


And we can create a new report in Power BI Site, same way as what Cameron has demonstrated in his post:


In my lab, I have created the dataset and imported the Power BI report file to Power BI Site few days ago. From the above screenshot, you can see the performance data collected today (as highlighted in red). This means the Power BI Site is directly quering my On-Prem OpsMgr DW DB in real time via the Power BI Enterprise gateway. And when I checked my usage, the OpsMgr DW DB dataset has only consumed 1MB of data:



In this post, I have demonstrated how to extend the PowerBI report and dashboard you have build in PowerBI Desktop located in your On-Prem environments to the cloud based version – Power BI Site, via the newly released Power BI Enterprise Gateway (still in preview at the time of writing).

Although we must have a Power BI Pro account in order to leverage the Power BI gateways, since are using direct query method when connecting to the OpsMgr DW database, this solution should not consume too much data from your monthly allowrance for the PRO user.

The performance for the report is really fast. My OpsMgr management group and the Power BI Enterprise Gateway server is located in my home lab, which is connected to the Internet only via an ADSL 2+ connection.

This is certainly a cheaper alternative OpsMgr dashboarding solution (compared with other commercial products). Additionally, since it is hosted on the cloud, it is much easier to access the reports and dashboard no matter where you are. Power BI also provides mobile apps for all 3 platforms (Windows, iOS and Android), which you can use to access the data using your preferred mobile devices. You can find more information about the mobile apps here: https://powerbi.microsoft.com/en-us/mobile

You also have the ability to share the dashboards you have created with other people within your organisation.

Squared Up Released version 2.3

Written by Tao Yang

Few weeks ago, the Squared Up folks sent me the preview bits for version 2.3. I haven’t had time to play with it until today.

There have already been few posts about v2.3, i.e. the post by Squared Up, and the post by my friend and CDM MVP Daniele Grandini.

When I was reading the feature intro that Squared Up sent me, the one feature that really stood out for me was the Open Access Dashboards. You can read the feature description from Squared Up’s post here.

So basically, once you’ve made necessary configurations to support this feature and enabled Open Access on a dashboard, the IIS that’s hosting Squared Up would generate an image of the specific dashboard (in .png format), which you can open in any browsers without having to login to Squared Up. This image will be regenerated every 60 seconds, and the URL to this image uses a randomly generated GUID (in order to hide the URL of the full blown version of the dashboard).

SQUPOpenAccessIn the past, I’ve worked in environments where people had to create a read-only operator in OpsMgr for having Squared Up dashboards on big LCD screens on the wall. It is an admin overhead to manage this account and the password, not to mention that I’ve also seen it many times that when managers walk past, the dashboard is sitting at the login screen on the wall LCD screens because the session was expired. It doesn’t make the team look good Sad smile.

The Open Access dashboards addressed these issues, it would be a great feature for those who uses Squared Up on big screens hanging on the wall.

So if you haven’t upgraded your Squared Up instance to v2.3, I strongly recommend you to take a look at this great feature and start planning your upgrade Smile.

Automating OpsMgr Part 19: Creating Any Types of Generic Rules

Written by Tao Yang


This is the 19th instalment of the Automating OpsMgr series. Previously on this series:

Although I have written number of functions in the current version of the OpsMgrExtended module that allows you to  create some popular types of rules in OpsMgr (i.e. perf collection rules and event collection rules). Sometimes, you still need to create other types of rules, such as WMI event collection rules, or rules based on module types written by yourself. In this post, I will demonstrate how to create any types of rules using the New-OMRule function.

Additionally, since the OpsMgrExtended module can be used on both your on-prem SMA infrastructure as well as on your Azure Automation account (with the help of Hybrid Workers), and pretty much all the previous runbooks and posts are based on SMA, I will use Azure Automation in this post (and maybe in the future posts too). I will demonstrate 2 sample runbooks in this post. Since Azure Automation now supports PowerShell runbooks on both Azure runbook workers as well as on hybrid workers, with the 2 sample runbooks I’m going to demonstrate, one is based on PowerShell workflow and the other one is a PowerShell runbook.

What Components are OpsMgr Rules Made Up?

Before we diving into the sample runbooks, please let me explain how are the OpsMgr rules made up. In OpsMgr, a rule is essentially a workflow that contains the following components:

  1. One or more Data Source modules
  2. Zero or one Condition Detection Modules
  3. One or more Write Action modules

To explain in plain English, a rule can have multiple data source modules and write action modules, but condition detection module is optional, and you can only use up to 1 condition detection module in your rule. The order of execution is Data Source Modules –> Condition Detection Module –> Write Action Modules. Additionally, some modules requires mandatory and/or optional configuration parameters (i.e. System.SimpleScheduler), some modules do not require any configuration parameters (i.e. Microsoft.SystemCenter.CollectPerformanceData).

OM-Rule Design Consideration

When I was writing the New-OMRule function, I have realised in order to capture all required information for each member module, the following information is required:

  • Module Type Name (Mandatory)
  • Configuration (Optional)
  • Member Module Name (Mandatory)
  • RunAs Profile Name (Optional)

i.e. in the example below, I have high lighted the information required in a member module of a rule.


Other than the information listed above, if we are writing an alert-generating rule, we would also need the following information for the alert configuration:

  • String Resource
  • Language Pack ID
  • Alert Name
  • Alert Description

I needed to figure out a way to enforce users to supply all required information listed above. In order to do that, I think the best way is to define a class for member module configurations and another class for alert configurations. However, since class definition is a new concept only been introduced in PowerShell version 5 (which still in preview other than Windows 10 machines at the time of this writing), I could not do this natively in PowerShell. In order to work around this limitation, I have defined these two classes in OpsMgrExtended.Types.dll using C#. This DLL is shipped as part of the OpsMgrExtended module.


The OM-Rule is expecting instances of these classes defined in OpsMgrExtended.Types.dll as input parameters. You will see how I used these classes in the sample runbooks.

Sample PowerShell Runbook: New-WMIPerfCollectionRule

OK, let’s start with a “simpler” one first. The New-WMIPerfCollectionRule runbook is a PowerShell runbook that can be used to create perf collection rules based on WMI queries. I think it’s simpler than the other one because it’s a PowerShell runbook (as opposed to PowerShell workflow) and we don’t have to worry about configuring alerts for the rules created by this runbook. The source code for this runbook is listed below:

As you can see, this runbook requires the following input parameters:

  • RuleName – the internal name of the rule
  • RuleDisplayName – the display name of the rule. this is what people will see in OpsMgr console
  • ClassName – The internal name of the target class (i.e. “Microsoft.Windows.OperatingSystem”)
  • WMINameSpace – the WMI name space of where the WMI class you are going to query resides. This is optional. if not specified, the default value of “Root\CIMV2” will be used
  • WMIQuery – the WMI query to retrieve the performance counter value
  • IntervalSeconds – the rule execution interval in seconds. this is optional, if not specified, the default value of 900 (15 minutes) will be used.
  • ObjectName – The object name for the performance data (i.e. Process, or LogicalDisk)
  • CounterName – the counter name for the performance data (i.e. ProcessCount, or FreeSpaceMB)
  • InstanceNameWMIProperty – the property returned from the WMI query which represent the performance data instance value (i.e. if you are collecting logical disk counters, the result of WMI query may contain a property that represent the drive letter, which can be used to identify the instance in perf data). This is optional, if not specified, the perf data instance name would be “_Total”.
  • ValueWMIProperty – the property returned from the WMI query that represent the perf value.

The first step of this runbook is to retrieve a connection object named “OpsMgrSDK_Home” from my Azure Automation account (or SMA). This connection object is pre-configured, which contains the computer name of one of my OpsMgr management servers, and the credential of a service account which has OpsMgr admin privilege in my management group.


The runbook also needs to explicitly import the OpsMgrExtended module. During the test, I found for this PowerShell runbook, I must manually import the module using Import-Module cmdlet in order to load the assemblies defined in the OpsMgrExtended.Types.dll. Since we are going to be using hybrid workers, you must manually deploy this module to your hybrid workers because at the time of this writing, Azure Automation is not able to automatically deploy required modules to hybrid workers.

Next, we must define the module configurations for each member module used by the WMI perf collection rules that this runbook creates. I have determined this type of rules should be configured using the following modules

  • One Data Source Module
    • Microsoft.Windows.WmiProvider
  • One Condition Detection Module
    • System.Performance.DataGenericMapper
  • Three Write Action Modules
    • Microsoft.SystemCenter.CollectPerformanceData
    • Microsoft.SystemCenter.DataWarehouse.PUblishPerformanceData
    • Microsoft.SystemCenter.CollectCloudPerformanceData

To explain in English, the rules created by this runbook would periodically execute a WMI query (Data source module), then map the result from WMI query to OpsMgr performance data (Condition detection module), finally store the performance data in OpsMgr operational DB, data warehouse DB and also OMS workspace (3 write action modules).

So we will need to use the New-OMModuleConfiguration function from the OpsMgrExtended PS module to create an instance of the “OpsMgrExtended.ModuleConfiguration” class. As explained earlier, the “OpsMgrExtended.ModuleConfiguration” class is defined in the OpsMgrExtended.Types.dll. Take the data source member module as an example:

I have placed the module type name, module configuration and the member module name into separate variables and passed them to the New-OMModuleConfiguration function and created a module configuration object for the data source module.


You can use Get-Help New-OMModuleConfiguration to access the help file for this function. If you need to use an alternative OpsMgr RunAs profile to for any member modules, you can also specify the name of the RunAs profile you are going to use with the –RunAsMPName and the –RunAsName parameter. The RunAsMPName parameter is used to specify the internal name of the management pack that defined the RunAs profile, and the RunAsName parameter is used to specify the internal name of the RunAs profile (i.e. if you are creating rules for SQL related classes, you might need to use the default SQL RunAs Profile, in this case, the –RunAsMPName would be “Microsoft.SQLServer.Library” and –RunAsName would be “Microsoft.SQLServer.SQLDefaultAccount”.)

Since a rule can have multiple data source modules and multiple write action modules, the New-OMRule function is expecting the array type of input for data source modules and write action modules. This is why even there is only going to be one data source member module or write action member module, we still need to place them into separate arrays before passing into the OM-Rule function:



On the other hand, since the condition detection member module is optional, and you can only have maximum one condition detection member module, you do not need to place the module configuration object for the condition detection module into an array.

Lastly, I have hardcoded the management pack name to be “Test.OpsMgrExtended” in this sample runbook. this MP must be created prior to running this runbook otherwise it would fail. However, if you have a look at the sample runbooks in previous posts, you can easily figure out a way to firstly detect the existence of this MP and use this runbook to create the MP if it does not exist in your management group.

Now, it’s time to take this runbook for a test run. I’m using the following parameters during the test run:

  • RuleName: “Test.WMIPerfCollection.Process.Count.WMI.Performance.Collection.Rule”
  • RuleDisplayName: “Windows Server Process Count Performance Collection Rule”
  • ClassName: “Microsoft.Windows.OperatingSystem”
  • WMIQuery: “select Processes from Win32_PerfRawData_PerfOS_Objects”
  • ObjectName: “Process”
  • CounterName: “ProcessCount”
  • ValueWMIProperty: “Processes” –verbose

And I have specified to run on a hybrid worker group:


The hybrid worker will pick up this job very soon, and during this test run, the job was completed around 2 minutes. after the job finishes, I’m able to find this rule in OpsMgr console:



Sample PowerShell Workflow Runbook: New-WindowsEventAlertRule

Now, let’s take a look at the second sample runbook. This runbook is designed to create rules that detects certain event log entries and generates alerts upon detection. I think it’s more complicated than the first sample because this is a traditional PowerShell workflow runbook (which works on both SMA and Azure Automation), and we also need to configure alert settings for this rule. The source code for this runbook is listed below:

This runbook takes the following input parameters:

  • RuleName – the internal name of the rule that you are creating
  • RuleDisplayName – the display name of the rule
  • ClassName – The internal name of the target class (i.e. “Microsoft.Windows.OperatingSystem”)
  • EventLog – the name of the event log (i.e. “System”)
  • EventID – the ID of the event that you are detecting
  • EventSource – is what you see as “source” in Windows event log
  • EventLevel – can be one of the following value:
    • Success
    • Error
    • Warning
    • Information
    • Audit Failure
    • Audit Success
  • AlertName – the alert name / title
  • AlertSeverity – can be one of the following value:
    • Critical
    • Warning
    • Information
  • AlertProirity – can be one of the following value:
    • Low
    • Medium
    • High

As you can see, firstly, other than the standard process of retrieving the connection object for my OpsMgr management group, I have used several “Switch” statements with inline scripts to translate the event level, alert priority and alert severity from English words (string) to numbers (integer), because when configuring member modules for OpsMgr rules, we must use the number (instead of names). Note I’ve also used “ValidateSet” to validate the input of these parameters, so only valid inputs are allowed.

I am not going to explain the member module configurations again, because I’ve already covered it in the first sample. But please note because the rules created by this runbook will be generating alerts, we must configure alert settings. In OpsMgr, when a workflow is configured to generate alerts (either rules or monitors), other than the rule / monitor itself, we must also define a String Resource for the alert message ID, as well as defining the alert name and description in a preferred language pack (by default, ENU). Therefore, we are going to use another class defined in OpsMgrExtended.Types.dll for alert configuration. The class for alert configuration is called OpsMgrExtended.AlertConfiguration, and you can use New-OMAlertConfiguration function to create an instance of this class. Same as all other functions in the OpsMgrExtended PS module, you can use Get-Help cmdlet to access the help file for New-OMAlertConfiguration. You will need to specify the following input parameters for New-OMAlertConfiguration:

  • AlertName – the name / title of the alert
  • AlertDescription – the alert description / detail
  • LanguagePackID – the 3-letter language pack code for the language pack that you wish to create the alert message under. this is an optional parameter, if not specified, the default value of “ENU’’ will be used.
  • StringResource – the ID for the alert string resource

As you can see, since the write action member module for the rules created by this runbook would be “System.Health.GenerateAlert”, and we are defining <AlertMessageId> and <AlertParameters> in the write action member module configuration:


The String Resource must match the AlertMessageId:


And if you have previously authored OpsMgr management packs, you’d probably already know how to define the <AlertParameters> section for the alert description. Basically, any variables you are using in the alert description must be defined in the <AlertParameters> section, then in the alert description, you’d reference them using “{}” and a number inside. <AlertParameter1> becomes {0}, <AlertParameter2> becomes {1}, and so on. You can up to define 10 alert parameters:


Since you can define multiple alert messages (for multiple language packs), when you are creating alert generating rules, the New-OMRule function would expect you to pass in an array that contains OpsMgrExtended.AlertConfiguration objects. So, even if you are only defining the alert in one language pack, please still place it into an array before passing to the New-OMRule function:


OK, now, let’s give this runbook a test run with the following parameters:

  • RuleName: “Test.Disk.Controller.Event.Alert.Rule”
  • RuleDisplayName: “Disk Controller Error Event Alert Rule”
  • ClassName: “Microsoft.Windows.OperatingSystem”
  • EventLog: “System”
  • EventID: 11
  • EventSource: “Disk”
  • EventLevel: Error
  • AlertName: “Windows Disk Controller Error”
  • AlertSeverity: Critical
  • AlertPriority: High


After the hybrid worker in my lab executed the runbook, I am able to see the rule created in OpsMgr console:



and the raw XML (once I’ve exported the MP):


Hybrid Worker Configuration

Since the samples in this post are all based on Azure Automation and Hybrid worker, I just want to point out this article if you need help setting it up: https://azure.microsoft.com/en-us/documentation/articles/automation-hybrid-runbook-worker/

Also as I mentioned earlier, you will need to deploy OpsMgrExtended module manually on to the hybrid workers by yourself. When copying the OpsMgrExtended module to your hybrid workers, make sure you copy to a folder that’s listed in the PSModulePath environment variable. During my testing with a PowerShell runbook, I initially placed it under “C:\Program Files\WindowsPowerShell\Modules” folder, as it was listed in the PSModulePath environment variable when I checked in a PowerShell console on the hybrid worker. However, I got error messages telling me the runbook could not find commands defined in the OpsMgrExtended module. To troubleshoot, I wrote a simple PowerShell runbook:


and based on the output, the folder in “C:\Program Files” is not listed!


Therefore, I had to move the module to another location (C:\Windows\System32\WindowsPowerShell\v1.0\Modules). after the move, the runbook started working.


In this post, I have demonstrated how to use the New-OMRule function from OpsMgrExtended PS module to create any types of rules in OpsMgr. Although OpsMgrExtended module has already shipped two other functions to create event collection and performance collection rules, the New-OMRule fills the gap that allows users to specify each individual member module and its configurations. This is probably the most technically in-depth post in the Automating OpsMgr series. I have tried my best to explain and demonstrate how to use the New-OMRule function. But if you are still unclear, have questions or issues, please feel free to contact me.

I haven’t figured out what I will cover in the next post, but I still have a lot to cover in this series. Since I am attending few conferences in the coming weeks in November, I probably won’t have time to work on part 20 until end of November. Until next time, happy automating!

Accessing OpsMgr Data on Your Mobile Devices through OMS Mobile Apps

Written by Tao Yang


Last year, my friends Cameron Fuller and Blake Wilson from Catapult Systems have written number of posts on “Taking my OpsMgr with me” (Part 1, Part 2, Part 3, Part 4, Part 5). In their blog post series, Cameron and Blake have demonstrated multiple ways of accessing your OpsMgr data from mobile devices via number of 3rd party applications such as Xian Wings, Squared Up, Savision Live Maps, etc.

With the recent release of Microsoft Operations Management Suite (OMS) Android and iOS apps, the OMS mobile apps would be another good option when you need to access your OpsMgr data on your mobile devices.

As we know, we normally categorise OpsMgr data into the following areas:

  • Alert Data
  • Event Data
  • Performance Data
  • State Data
  • Managed Entity Data

Once you have connected your OpsMgr management groups to your OMS workspace, with some additional configuration (i.e. configuring collections for log and Near Real-Time Perf data, enabling Alert Management and Capacity Planning solutions, etc.), we can easily access Alert data, Event data and Performance data from OMS. Unlike OpsMgr, since OMS does not implement object health model (monitoring classes and relationships), the State data and Managed Entity data has become irrelevant in this case.

In this post, I will show you some sample search queries and dashboards I have developed in my lab, and what these dashboards look like in the OMS Android app (from my Samsung Note 3 mobile phone).

First of all, OMS already comes with some useful built-in dashboards:


These built-in dashboards covered top level overview of alert data, perf data, event data, configuration changes data ,etc. Which are good starting point for you to drill down by tapping (or clicking) the dashboard tiles. i.e. the drill down from the “Alert raised during the past 1 day grouped by severity” tile:


I also managed to produced the following Saved Searches and then pined them on the dashboard:

OpsMgr Management Server Heartbeat Event For the Last 15 Minutes

Using the OMS Add-On MP from version 2.5 of the OpsMgr Self Maintenance MP, I configured management servers to send heartbeat events to OMS every 5 minutes. The search query for this dashboard tile is:

Type=Event Source=OMSHeartbeat Computer=OMMS01 TimeGenerated>NOW-15MINUTE | measure count() by TimeGenerated

I also configured a threshold that would hightlight when the value is under 3:


As you can see, this dashboard tile has also changed colour in the OMS Android app just like the full blown web console:


Top 3 OpsMgr Offenders for the Last 24 Hours

In OpsMgr, we would often interested in finding out which monitoring objects has generated the most of the alerts. This can be easily achieved using a very simple search query in OMS:

Type=Alert AlertState=New TimeGenerated>NOW-24HOURS | measure count() by SourceFullName | Top 3


From this tile, I can see that most of the alerts generated in my management groups are Office 365 related.

Error Events from the “Operations Manager” Event Log for the Last 24 Hours

If I want to see how many error events have been generated in the “Operations Manager” log on all the computers managed by OMS, I can use a query like this one:

Type=Event EventLevelName=error EventLog=”Operations Manager” TimeGenerated>NOW-24HOURS


From this tile, I can then drill down by tapping the dashboard tile



from this tile, you may have noticed there are only few bars for the recent time frames. this is because I have specified the query only return the events generated from the last 24 hours and the default time range for the OMS app is the last 7 days:


Hyper-V Hosts Available Memory

Once you have configured the pre-requisites and enabled the Capacity Planning solution in OMS, this solution will start collecting various performance counters from your VMM managed Hyper-V hosts. The performance data collected by this solution is stored as hourly aggregated perf data (Type=PerfHourly). Therefore, we are able to get some common perf counters such as Memory Availability MBytes using a simple query like this:

Type=PerfHourly CounterName=”Available MBytes” |Measure Avg(SampleValue) AS AVGMemory by Computer | sort AVGMemory


And you can drill down from this tile:


From here, I can see in my lab, a Hyper-V host running on an Intel NUC has the least amount of available memory.

In my opinion, using the OMS mobile app has the following advantages comparing to the various mobile apps for OpsMgr:

Support for multiple management groups and stand alone agents

Since you can connect multiple OpsMgr management groups into a single OMS workspace, and you are also able to connect standalone computers directly to OMS, the data returned from your search queries are consolidated among all data sources, not just one single management group.

Cloud Based Solution

Since OpsMgr is primarily designed to monitor your on-prem infrastructure, generally your OpsMgr infrastructure would be place somewhere in you on-prem data centre. Therefore in order to access your OpsMgr data via a mobile app remotely, you’d either need to connect to your corporate network via VPN, or your network team would need to create some kind of reverse proxy tunnel for you to access your OpsMgr web based portal (such as Squared Up) from the internet. This adds additional complexity in your solution. By using the OMS mobile apps, since the data is hosted on Azure, you do not need any kind of connectivity between your mobile device and your on-prem data centres.

My fellow CDM MVP Steve Buchanan has also written an awesome overview for the Android app few days ago, you can read Steve’s post here: http://www.buchatech.com/2015/10/unpacking-the-operations-management-suite-android-app/

Cameron has also just posted his experience with the iOS app on iPad on his blog: http://blogs.catapultsystems.com/cfuller/archive/2015/10/21/the-microsoft-oms-experience-on-an-ipad/

Lastly, I recommend you to give the OMS mobile apps a try, they are currently available on all 3 platforms (Windows Phone, Android and iOS). If you do have your OpsMgr management groups connected to OMS, this app could come very handy Smile.

Top Community Resources for SCOM and OMS Webinar

Written by Tao Yang

Few weeks ago, I presented a session on Top Community Resources for SCOM and OMS for Squared Up’s UK community workshop (http://blog.tyang.org/2015/10/05/top-community-resources-for-scom-and-oms/). Squared Up has asked me to present this again for the broader community since it was well received by the audiences from the workshop.

So I’m going to present this session few more times. They are free to register and attend. You can find the details from Squared Up’s website: https://squaredup.com/tao-yang-presents-top-community-resources-for-scom-and-oms/

Additionally, after the initial presentation, I notice I forgot to include some awesome resources, I will add them in this time.

Automating OpsMgr Part 18: Second Update to the OpsMgrExtended Module (v1.2)

Written by Tao Yang


This is the 18th instalment of the Automating OpsMgr series. Previously on this series:

Before I diving into the topic of creating generic rules using the New-OMRule function from the OpsMgrExtended module, I have updated this module again. It is now on version 1.2.

I was working on another project and I needed to use the New-OMRule function to create rules and I realised this function did not support specifying optional RunAs accounts for member modules. As I needed to create rules that use a RunAs account in the data source module, I had to update this function to accommodate it.

Additionally, as I mentioned in the previous post (Part 17), there is a bug in the New-WindowsServiceTemplateInstance function, where the description field is not populated. I have also fixed it in this release.

What’s New?

So, in summary, here’s what’s changed:

  • Updated OM-Rule function to allow specifying optional RunAs profile for each member module.
  • Fixed the issue in New-WindowsServiceTemplateInstance function where the description field is not populated.

Where to Download V1.2?

I have updated the original link, so you can download this updated version at TY Consulting’s web site: http://www.tyconsulting.com.au/portfolio/opsmgrextended-powershell-and-sma-module/


Now that I’ve updated and enhanced the New-OMRule function I will demonstrate how to create rules using this function as planned in the next module.

Top Community Resources for SCOM and OMS

Written by Tao Yang

Last Friday, as part of the Squared Up UK community workshop, I have presented my recommended resources for SCOM and OMS. I have covered may blogs, sites, management packs and other utilities for SCOM and OMS.

CQTGK3-WoAA7IzF.jpg large

I know that many friends have mentioned my work and myself in many occasions in the past, but I have never really “returned” any favours. So after the presentation on Friday, I’ve decided to share my slide deck here, hopefully, you’ll find something useful from it.

You can download it from the link below: