Getting Started

The easiest way to get going is to install the SCOM UI on the machine that you want to develop on. This will ensure all the necessary components are installed and drop the assemblies you need in order to write against the SDK. There is currently a work item being tracked to have a special installer for just the SDK and any necessary components in order to easily facilitate developing on a non-SCOM box. Hopefully we can get this in for RTM, if not, I'll make sure to post exact instructions when that time comes.

Programmatically, the only assemblies of interest are:

Microsoft.EnterpriseManagement.OperationsManager.dll (The main SDK assembly)

Microsoft.EnterpriseManagement.OperationsManager.Common.dll (A common assembly that the SDK service and client share, containing mostly exceptions)

Although in Beta 2 there was also a dependency on EventCommon.dll and Microsoft.Mom.Common.dll, both of these dependencies have been removed for the upcoming release candidate and will not be present at RTM.

If you want to develop and run on a machine that does not have the UI installed, you will need to:

  1. Copy over the assemblies mentioned above (the two main assemblies in bold will have to be copied from the GAC) to a directory on the machine you want to develop on.
  2. Copy over Bid2ETW.dll from the SCOM install directory to the same machine.
  3. Install the correct version of Microsoft .Net Framework 3.0.
  4. In the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\BidInterface\Loader add a new string value: “<Directory where you code will be running>\*”=”<Path to Bid file from #2>\Bid2ETW.dll”

This should be everything you need to do to setup your dev machine. Now just link against the assemblies and you're ready to get started.

The first thing any application needs to do in order to work with SCOM is create a new ManagementGroup object.  The sample code below creates a ManagementGroup connected to the local machine (Note: In order for this code to work, it needs to be run on the Primary Management Server.)

using System;

using Microsoft.EnterpriseManagement;

 

namespace Jakub_WorkSamples

{

    class Program

    {

        static void Main(string[] args)

        {

            ManagementGroup localManagementGroup = new ManagementGroup("localhost");

        }

    }

}

 

With this object, you can begin to explore the rest of the API and accomplish, hopefully, any tasks you need to. In future posts, I will talk more about connecting options and the ManagementGroupSettings class, but for now, this should get you started.

EDIT - In recent builds (I believe RC1 included) you do not need to do step 2 and 4 above, unless you want SCOM tracing to work.