Blog
Archive
<May 2013>
SunMonTueWedThuFriSat
2829301234
567891011
12131415161718
19202122232425
2627282930311
2345678
Monthly
Go
Search
  |  Register
Author: Created: Tuesday, September 09, 2008 1:58:59 PM RssIcon
News and updates about code4ward.net
By Stefan Koell on Sunday, March 24, 2013 6:41:53 PM

I’m building a new lab environment for my System Center stuff. Unfortunately I’m so busy lately, that it took a while to pick up where I left:
Building my System Center SP1 Lab - Part 1: Domain Controller

In this blog post I want to install a SQL 2012 SP1 server on Windows Server 2012. I’ve never installed SQL 2012 so let’s see what happens.

Since I plan to use this SQL server instance as a shared instance for multiple System Center components I will use SQL Server Enterprise Edition to get some advanced stuff in Service Manager and I also need to be careful what collation to install. More about this later…

Why Enterprise Edition?

In general, both editions (Standard and Enterprise) are supported for Service Manager but there are a couple of enhancements which are only available if your Service Manager installation is located on an Enterprise edition. For more information, read this TechNet article:
http://technet.microsoft.com/en-us/library/hh495585.aspx

Note: The new System Center licensing introduced with System Center 2012 includes all necessary licenses for SQL Standard installations. So if you decide to use SQL Enterprise in your production environment you need to properly license the instance (or install it on an already licensed instance) in order to use SQL Enterprise. To be clear, if you use SQL Standard edition, no licenses are necessary as they all are covered by the System Center license.

Installing SQL Server 2012 SP1

After installing Windows Server 2012, joining the server to my lab domain and installing all available updates, setup.exe on the SQL installation media is opened:

image

After the prerequisites are checked, you will be asked for the product key. Enter the key (or select you want to evaluate) and click Next:

image

I’m not really a SQL expert (in fact I’m far away from being anything else as a SQL noob), so the setup is kind of exciting for me. My first pleasant surprise is this nice wizard page:

image

SQL 2012, will lookup all the updates available online for the version you install and offers you to download and install them right away. After clicking next, the wizard will download the online files (in case you accepted the updates in the previous page) and extracts all the setup files before it will continue:

image

Ok, enough praise on the setup. I left my windows firewall on and I got the above warning. Nothing wrong with the warning but the message box shown when you click the Warning link is kind of useless because there’s a link in the message which cannot be clicked. I know you can CTRL-C when the message box is focused to get the text into the clipboard but this is just note really user friendly. In addition, I would expect the setup to open all necessary ports (as SCOM is doing) but maybe this is on purpose for security reasons… Let’s check that later and continue.

The next screen asks us for the “Role”. We go with the SQL Server Feature Installation:

image

On the Feature Selection screen we check the three main instance features (DB Engine, Analysis Services, Reporting Services) as we use the instance for SCOM and SCSM and maybe other products. Note that the Reporting Services can only be installed and used for one product (either SCOM or SCSM) but not for more than one.

image

The shared features I selected aren’t mandatory to run the System Center components/products. I chose to have them on board (especially the management tools) for my convenience.

The next screen allows you to configure the instance (name) as well as the default directory paths:

image

The Disk Space Requirements page will show you a short summary if all components can be installed on the selected/configured drives. If you have enough disk space, click on next to get to the Server Configuration screen. On the Service Accounts tab I leave all configuration as they were, except for the Agent. I prefer to let the agent start automatically. The more interesting stuff is the Collation tab:

image

Since my Windows OS is using English US locale, SQL setup by default suggests the “correct” collation for my scenario. If you are using only english you can go ahead and use the shown collation to successfully install and use SCOM/SCSM and other SC components on the same SQL instance. For production scenarios you may want to separate the database for SCOM and SCSM because of the workload both systems have on the DB. If you want to run both systems on the same DB, check the following blog post if your language you intend to use on those systems are supported and which collation you need to install:

http://blogs.technet.com/b/servicemanager/archive/2012/05/24/clarification-on-sql-server-collation-requirements-for-system-center-2012.aspx

On the next three screens, make sure you leave the default values but also make sure your current user is in the list. Just click the “Add Current User”  button to add your user.

On the Error Reporting page you may choose to report error and usage data to MS. Click on Next, verify if the Installation Configuration Rules are good to go and hit Install.

That’s it for today. I hope the server as configured and install will work for my upcoming installations of SCOM and SCSM.

cheers,
Stefan

By Stefan Koell on Wednesday, January 02, 2013 11:16:18 AM

 

Microsoft published a section on TechNet which gives you an overview of what’s new and changed in System Center SP1: http://technet.microsoft.com/library/jj649385.aspx

Here’s my list of improvements/features from SP1 which are really cool and noteworthy:

By Stefan Koell on Tuesday, January 01, 2013 3:02:30 PM

Everyone who is working with System Center products should have a lab/test/staging/whatever-you-want-to-call-non-production environment. System Center SP1 “RTM’ed” and I thought, let’s build a new lab environment. Most of the time, you will use parts of your existing infrastructure (like Active Directory or maybe even an existing SQL server) to setup your lab environment. This time I wanted to build a completely isolated test environment with my own, dedicated AD and dedicated SQL server. So this part will focus on setting up a new domain for my lab.

Before Windows Server 2012 was released, there were some limitations/issues with virtualized DCs, especially if you had no physical DCs at all. Windows Server 2012 has many new features and improvements, especially when it comes to running DCs virtualized. Read more about these improvements here: http://www.aidanfinn.com/?p=13171

You may also check out “Virtual Domain Controller Technical Reference (Level 300)” on TechNet: http://technet.microsoft.com/en-us/library/jj574214.aspx

Setup VM

The VM will be hosted and running on a Windows Server 2012 Hyper-V machine. The system requirements of a Windows Server 2012 DC didn’t change and are basically the same as for Windows Server 2008 R2. Minimum RAM is 512MB, recommended is 2GB, so I will go with 1024MB RAM initially. My lab environment will be very small and I can always increase resources if I need them. You may also consider enabling dynamic memory but I couldn’t really find some useful guidance about dynamic memory and domain controllers. If there’s any good read on that topic, let me know. I connect the VM to my virtual network and the max. size of the extending HD will be 500 GB (just to be safe). I also recommend to assign at least 2 virtual CPUs to your VM.

Since this is a lab environment I will also only install one DC (at least for now). I will backup all lab VMs on a daily basis but I do not really care about uptime.

Windows 2012 Domain Controller

After Windows 2012 is installed, make sure to provide a static IP address to your DC-to-be. I also tend to leave IPv6 enabled and set a static address as well. There’s a lot of discussion whether or not to disable IPv6 and usually people think, disable it if you don’t need it. Anyway, MS recommends to leave it enabled and since it’s enabled by default, I leave it that way. I use the IPv4 to IPv6 converter to create IPv6 addresses: http://www.subnetonline.com/pages/subnet-calculators/ipv4-to-ipv6-converter.php

If this is your first Windows 2012 Domain Controller and you’re still trying to use “dcpromo” to create a domain controller, you will see a message like “The Active Directory Domain Services Installation Wizard is relocated in Server Manager…”.

In the Server Manager, go to Manage –> Add Roles and Features:

image

Once the Wizard appears, skip the first page and select Role-based or feature based installation:

image

In the next screen we leave the “Select a server from the server pool” and keep the computer we want to promote to a DC selected in the server pool list. On the Select server roles screen we check the Active Directory Domain Services box:

image

After you’ve checked the checkbox, the Add Roles and Features Wizard appears. Just click on Add Features to continue and also check the DNS Server checkbox. Again, click the Add Features button when the Add Roles and Features Wizard appears for the DNS Server role.

You can skip the next three pages as we do not install any additional features on that server at this time. Two pages are only providing additional information about the AD DS and DNS Server role.

On the Confirmation page I chose to automatically restart the server if it is required:

image

I hit Install and off we go…

The Server Manager will show a warning triangle after the role installation completed:

image

Click on the “Promote this server to a domain controller”. In my case, I’m installing a complete new, isolated forest:

image

Next up, Domain Controller Options:

image

Since I’m not integrating DNS with an existing DNS infrastructure, “no action is required”:

image

Specify a NetBIOS name:

image

I leave the Path configuration as it is:

image

After the Review Options page, you will see the Prerequisites Check:

image

A bunch of warnings (compatibility, DNS) but at the bottom you should read “All prerequisite checks passed successfully.”. Then click on Install. After a while the server will reboot.

Once the machine is up again you will see the two roles in the dashboard:

image

One important step after installing a DC is to setup time synchronization: http://support.microsoft.com/kb/816042/en-us#method2

That was pretty painless and considering my focus to the System Center Suite it’s kind of “off-topic” but maybe this is useful to some of you – it will definitely serve me as “lab documentation” Winking smile

Stay tuned for the next part: SQL Server

Cheers and a happy new year!

Stefan

By Stefan Koell on Sunday, September 16, 2012 7:58:08 PM

A fairly common requirement from customers is to extend work item or configuration item classes and pull values from other systems (like Active Directory or some database) and put it into a new property of an existing class. Service Manager is very extendable and has some great feature to help you with that. To achieve a goal like this, you *just* need to “author” your own management pack and do some scripting or System Center Orchestrator magic.

Sounds complicated? Follow this blog post and you will see that it’s not that hard at all.

Here’s the high level overview of what to do:

  1. Identify the class you want to extend
  2. Create a management pack to extend the class
  3. Create a script (or Orchestrator runbook) to populate the new property/properties of your extended class

1. Identifying the class to extend

In this example I demonstrate how to extend the Active Directory User class (which is used and populated by the AD connector) to have a dedicated property for the primary email address. In case you wonder why I do this, you should know that SCSM handles email addresses using relationships and dedicated objects which makes it hard to just get a view of all users with a column showing the primary email address (as set in AD). With SCSM you cannot do this easily.

My fellow MVP colleague Anton Gritsenko is working on a tool called “Advanced View Editor for SCSM 2012” which will allow you to create a view to display the email addresses in a column. At this point it’s still beta but you should definitely check it out as you can do much, much more with this awesome tool!

Still, this blog post should be more like a demonstration on how to solve a problem like this in general: pulling some data from somewhere and populate an extended class.

Take a look at this Technet Library page to see how the AD connector is mapping objects to Service Manager:
http://technet.microsoft.com/en-us/library/hh524307.aspx

As you can see, it seems that the mail property from AD is synchronized with the Microsoft.AD.User property but if you try to create a view showing the Email property, you are out of luck:scsm01

At least, the Technet page gives us a clue what class we should extend: “Active Directory User” (ID = Microsoft.AD.User). In case you do not have a Technet page which is showing you the class ID, the easy way to find the ID (= Name) for the class is a PowerShell command like this:

Get-SCSMClass | where {$_.DisplayName –eq ‘Active Directory User’}

2. Create a management pack to extend the class

To extend a class we need to “author” a management pack. Since a management pack basically some XML definitions you could use a tool like notepad but it would require you to know the schema and exact syntax on how to create a management pack. A much easier way to create management packs is either the use of Service Manager Authoring Tool or the Visual Studio Authoring Extension (which allows you to not only create Service Manager management packs but also allows you to create Operations Manager management packs). Note, the Service Manager authoring tool was released for SCSM 2010 SP1 but it will also work for SCSM 2012 management packs.

Since we are only extending a class, I will use the Visual Studio Authoring Extension (which requires at least Visual Studio 2010 Professional). If you want to customize forms, I recommend you use the Service Manager Authoring Tool as this one has a graphical, designer like interface to do so.

Once I’ve installed Visual Studio 2010 and the Authoring Extensions, I create a new Project with the type: “Service Manager 2012 Management Pack”:
scsm02

Next, we need to add a reference to the management pack which holds the original class we want to extend. The Get-SCSMClass command above will also show the management pack name:
"Microsoft.Windows.Library”

Right-click on the "References” node in the Solution Explorer and select “Add Reference”. Navigate to the SCSM installation folder and browse for the file Microsoft.Windows.Library.mp:
scsm03

Next, click on the project in the Solution Explorer and right-click to select Add –> New Item…:
scsm04

Now, select Class and type a name like ADUserExtension.mpx:
scsm05

In the management pack fragment, paste the following code:

<ManagementPackFragment SchemaVersion="SM2.0" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <TypeDefinitions>
    <EntityTypes>
      <ClassTypes>
        <ClassType ID="code4ward.SCSM.ADUser.Extension.ADUserExtension" 
                   Base="Windows!Microsoft.AD.User" 
                   Extension="true"
                   Accessibility="Public" 
                   Abstract="false" 
                   Hosted="false" 
                   Singleton="false">
          <Property ID="PrimaryEmailAddress" Key="false" Type="string" />
        </ClassType>
      </ClassTypes>
    </EntityTypes>
  </TypeDefinitions>
  <LanguagePacks>
    <LanguagePack ID="ENU" IsDefault="true">
      <DisplayStrings>
        <DisplayString ElementID="code4ward.SCSM.ADUser.Extension.ADUserExtension">
          <Name>Active Directory User (Extended)</Name>
          <Description></Description>
        </DisplayString>
        <DisplayString ElementID="code4ward.SCSM.ADUser.Extension.ADUserExtension" SubElementID="PrimaryEmailAddress">
          <Name>Primary Email Address</Name>
          <Description></Description>
        </DisplayString>
      </DisplayStrings>
    </LanguagePack>
  </LanguagePacks>
</ManagementPackFragment>

The code snippet above looks basically almost the same as the code snippet you find after adding the new class item. Here’s what I changed and why:

  1. The class type ID was adjusted to be unique (usually you add those dot-separated naming like company.application.thing[.subthing] to uniquely identify your class).
  2. The base class is changed to the Microsoft.AD.User class in the Windows (alias for Microsoft Windows Library) management pack.
  3. The extension attribute is added to tell SCSM that we do not want a new class, instead we want to extend an existing class. This also ensures that all inherited classes get the new property/properties.
  4. The property id was changed to something meaningful: PrimaryEmailAddress.
  5. The display strings (here only English/ENU) were updated.

That’s it. Build the management pack and import it into your management group.

Note that for this demo I didn’t seal the MP. MPs with extensions or class definitions should be sealed when used in production.

After you have imported the MP you will see that the new property “Primary Email Address” is now available for the Active Directory User class (and all inherited classes):
scsm06

Also note that creating a new or editing an existing user would already allow you to use the new property:
scsm07

Because we didn’t adjust the user form, you will find all additional, custom properties on the Extensions tab.

3. Automatically populate the new property

Now, that we have successfully extended a class, we want to have it filled with data – preferably using a script or something which can be automated. In this example I will write a simple PowerShell script which can be executed on demand, using a scheduled task or invoked by a runbook.

$UserCIs = Get-SCClassInstance -class (Get-SCClass -name 'Microsoft.AD.User')
foreach ($UserCI in $UserCIs)
{
    $ADUser = Get-ADUser -Filter "SamAccountName -eq '$($UserCI.UserName)'" -Server $UserCI.Domain -Properties EmailAddress
    Write-Host Processing CI $UserCI.UserName
    Write-Host CI Email: $UserCI.PrimaryEmailAddress
    Write-Host AD Email: $ADUser.EmailAddress
    if ($ADUser.EmailAddress -ne $UserCI.PrimaryEmailAddress)
    {
        Write-Host CI and AD email address does not match!
        $UserCI.PrimaryEmailAddress = $ADUser.EmailAddress
        $UserCI | Update-SCSMClassInstance
        Write-Host CI was updated.
    }
    Write-Host ----------
} 

Let me explain the above script above:

  1. The approach here is to get all CIs from SCSM and compare each found entry with the one in Active Directory. You could go through the AD users and compare it with the CI classes but this should be much more efficient and better because you may not import all your AD users into the CMDB.
  2. For each CI object we get the corresponding AD user (note that you may need to specify which properties to load; in this case we just need the EmailAddress).
  3. Then we compare the email address from AD with the one from the CI (note that you just can refer to our extended property using $UserCI.PrimaryEmailAddress.
  4. The Update-SCSMClassInstance will commit the change of the CI object to the database.

Conclusion

As you can see, it’s not too hard to extend classes with additional properties and fill and update them automatically using some simple script. Please bear in mind that the content of this blog post is roughly a proof of concept and should be carefully tested, adapted and extended before you put it into production.

If you have any suggestions or feedback, let me know.

cheers,
Stefan
http://www.code4ward.net

By Stefan Koell on Thursday, August 16, 2012 10:45:49 AM

This release is mostly a maintenance release and includes several bug fixes. However, there are a couple of new things in this release which deserves some attention:

Ad Hoc Connection Improvement

As mentioned in this blog post, we’ve introduced some convenient features around ad hoc connections and the credential picker. We’ve now further improved the handling which allows you to enter a credential name in the URI followed by an @ character and the URI (hostname).

So let’s assume you have a credential called “lab\admin” (in the display name) and you want to use ad hoc connect to connect to a machine which isn’t yet in your document(s). By simply putting the credential display name (lab\admin) followed by an @ character and the hostname (like vm198) you can tell Royal TS to use the existing credential:

SNAGHTMLd256c95

Note this only works if the display name of the credential is unique. If multiple credentials are found with the same name (in different folders or documents), the credential picker will appear and display all matching credentials.

Of course, this will also work for other connection types.

New Replacement Tokens

In Royal TS V2, credential objects have a username and password field. For domain environments, the username field can be used to specify the domain and the username using the “domain\user” syntax. In this configuration the $EffectiveUsername$ replacement token will always return the domain and the user part.

In this release we are also introducing new replacement tokens:

$EffectiveUserdomain$ will return only the domain part of the username.
$EffectiveUsernameWithoutDomain$ will return only the user part of the username field.

image

You can use these two new replacement tokens in tasks, key sequences and template connections.

If a username does not have a domain part (domain\), the $EffectiveUserdomain$ value will be empty (whitespace) and the $EffectiveUsernameWithoutDomain$ will be the same value as the $EffectiveUsername$.

Download

The release notes can be found here: http://www.code4ward.net/main/RoyalTS/ReleaseNotes.aspx

To download the latest release, visit: http://www.code4ward.net/main/RoyalTS/Download.aspx

By Stefan Koell on Friday, August 03, 2012 11:00:26 AM

We’ve just released Royal TS 2.1.2 with a couple of bug fixes and performance optimizations. You can read the release notes here: http://www.code4ward.net/main/RoyalTS/ReleaseNotes.aspx

To download Royal TS 2.1.2, head over to our download page here: http://www.code4ward.net/main/RoyalTS/Download.aspx

This update is free for all Royal TS V2 license holders. If you experience any issues or want to provide feedback, please use our forums: http://www.code4ward.net/main/Forums.aspx

Best regards,
Your code4ward.net Team

By Stefan Koell on Monday, July 23, 2012 4:19:29 PM

code4ward.net released the first SCOM 2012 dashboard widget extension for SCOM 2012: Web View Widget Management Pack

Hopefully much more to come!

This weekend I had a little fun with SCOM and the new dashboards. Brian Wren posted a little (actually a huge!) guide on TechNet (including the files) about writing/authoring custom dashboard widgets. It wasn’t that easy because some parts of the guide didn’t quite match with the files and some things didn’t work as expected. Considering the size of the guide and judging from the screenshots, this guide was in the works for several months, maybe more than a year! To sum up, I’ve learned a lot and I will try to update the guide as good as I can and incorporate my experience as well.

Web View Widget

You may wonder why you need such a widget. There are plenty of reasons for that and while Microsoft ships a Web Page View for Operations Manager, they didn't ship a widget for the Dashboards. A web view widget might be very useful if you want to create a dashboard with SCOM data and data from other systems which provide a web interface - all in one view. Well, with this little enhancement you can do that now.

Features of this Management Pack

  • Configure a URL of a web page to load and display in the dashboard widget.
  • Personalize the widget to show/hide a navigation toolbar and to enable, disable, configure to auto refresh the page every x seconds.
  • The web console does not provide all navigation toolbar features.

Installation

To install the management pack, download the zip file from http://gallery.technet.microsoft.com/Web-View-Widget-Management-0d14bd0a and extract the file: code4ward.SystemCenter.WebViewWidgetPack.mpb

In the Operations Console, go to Administration -> Management Packs. Click on "Import Management Packs...". Add the management pack to the import list:

SNAGHTML20707b4

Click on Import to start the import process.

Using the new Dashboard Widget

First create a new Dashboard View in the Monitoring space or "My Workspace". Choose any layout for the dashboard and finish the wizard. Once the (empty) dashboard is loaded, click on "Click to add widget...":

image

Click on code4ward.net in the Template page and select "Web View Widget":

image

Click on next and provide a name and optional description for the widget you want to add. Click on next:

image

Enter the URL to the web page you want to load and display within the widget. Click on next and finish the wizard.

Once the dashboard is created and the widget(s) is configured you can personalize some settings:

SNAGHTML20b0e29

Note the gear icon which appears when you hover the mouse over the widget. Click on it to change the configuration or personalize the widget:

image

That's it. Not much but I think still useful. If you have any feedback or bug reports, contact me using the following email address:
stefan.koell (-at-) code4ward.net

http://code4ward.net

Disclaimer:
The information and management pack is provided "AS IS" with no warranties. Use at your own risk!

By Stefan Koell on Monday, July 16, 2012 12:14:20 PM

Last week we released Royal TS 2.1.1 which includes a number of bug fixes but also one new feature worth mentioning. Since 2.1.1 Royal TS supports serial port communication (RS232) using the newly introduced Terminal Connection:

SNAGHTMLe6739b

When you set the Connection Type to Serial Port, you can use the Serial Port configuration page to set up the port tweak various settings:

SNAGHTMLe7fc9c

Note: the Serial Port configuration page is only available when you set the Connection Type to Serial Port.

Now you can setup routers, switches or any other device capable of serial port communication:

clip_image002

cheers,
Stefan
code4ward.net

By Stefan Koell on Saturday, July 07, 2012 1:00:08 PM

Have you ever wondered how the Microsoft shipped management packs actually work? There are a couple of ways to look inside the Management Packs (MPs) and understand how they are actually working. Although you need a bit of PowerShell to get a glimpse inside the MPs, it’s worth a look…

Note: the code below only works on an Operations Manager 2012 installation – it will NOT work on SCOM 2007 (R2)!

Where are the Management Packs?

Well, in general, MPs are stored in the database as soon as they are imported but when you look at the ManagementPacks folder on the installation media you’ll see that all by default installed management packs are in this folder (and more).

All the management packs which are installed in your management group can be exported to readable XML easily by a little PowerShell cmd-let using the Operations Manager Shell:

Get-SCOMManagementPack | Export-SCOMManagementPack -Path c:\SCOM_MPS_AS_XML

Make sure the path as specified above exists or use your own output path. After executing the command, all your installed management packs (sealed AND unsealed!) will show up in the directory as XML.

In case you are wondering why MS ships all by default installed MPs as MP with the installation media, you’ve probably not done any MP authoring/development yet. When you author your own MPs using various tools you need them as reference for modules.

There’s another way to get readable XML from MPs. This blog post from Pete Zerger demonstrates how to unseal MPs using the SDK only (without a live management group). The code from Pete runs on SCOM 2007 (R2) but will not run in SCOM 2012 because the SDK, mainly the location of classes and namespaces changed. Here’s a modified snippet which runs on SCOM 2012:

$assembly = [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Core") | out-null
$MPs = Get-ChildItem C:\SC2012OMRTM\ManagementPacks\ -Recurse -Include *.mp
foreach ($mp in $MPs)
{
    $mgmtpack = New-Object Microsoft.EnterpriseManagement.Configuration.ManagementPack($mp)
    $mpWriter = New-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter("c:\SCOM_MPS_AS_XML")
    $mpWriter.WriteManagementPack($mgmtpack)
}

Note, that the assembly is a different one when you use the SCOM 2012 SDK, the rest is the same.

What’s inside the Management Packs?

With the above we managed to look deep inside the management packs and can now see how the shipped management packs are built and how they are working exactly. You can see, all the class definitions, discoveries, monitors, rules, views, folders, etc. For advanced authoring and development you can also see what modules Microsoft is using in their MPs. Modules are the basic building blocks for SCOM workflows. This is a great way to learn how to use certain modules. A complete list of documented and supported modules can be found here:
http://msdn.microsoft.com/en-us/library/jj130161.aspx

When you look at all the unsealed MPs you will realize that there are much more modules than the list MS is providing. You can of course also reference modules from management packs which are not in the list but keep in mind that MS may change the signature/parameterization of those modules and your MP may be screwed then. The list above is more or less a list with MS’ blessing and they try to keep them the way they are for compatibility reasons.

Wait, there’s more: Management Pack Bundles

With SCOM 2012, MS introduced a new packaging format for management packs called: Management Pack Bundles (.mpb files). Those of you who played around with Service Manager may already know about that. MS originally introduced bundles in Service Manager. It basically allows you to put resources like images or even assemblies in a management pack. Daniele Grandini and Stefan Stranger both blogged about that and provided a handy little script to dump the contents with all resources to the file system:

$inDir = "C:\SC2012OMRTM\ManagementPacks"
$outDir = "C:\SCOM_MPS_AS_XML"
 
[Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Core")
[Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.Packaging")
 
$mpStore = New-Object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackFileStore($inDir)
 
#now dump MPB files
$mps = get-childitem $inDir *.mpb
$mpbReader = [Microsoft.EnterpriseManagement.Packaging.ManagementPackBundleFactory]::CreateBundleReader()
if ($mps -ne $null)
{
    foreach ($file in $mps)
    {
        md ($outDir + "\"+ $file)  #ADDED     
        $mpWriter = new-object Microsoft.EnterpriseManagement.Configuration.IO.ManagementPackXmlWriter($outDir + "\"+ $file)    #ADDED   
        $mpb = $mpbReader.Read($file.FullName, $mpStore)
        foreach($mp in $mpb.ManagementPacks)
        {
            #write the xml
            $mpWriter.WriteManagementPack($mp)
            $streams = $mpb.GetStreams($mp)
            foreach($stream in $streams.Keys)
            {
                $mpElement = $mp.FindManagementPackElementByName($stream)
                $fileName = $mpElement.FileName
                if ($fileName -eq $null)
                {
                    $fileName = $outDir +'\' + ($mp.Name)+ '.' + $stream+ '.bin'
                }
                else
                {
                    If ($fileName.IndexOf('\') -gt 0)
                    {
                        #only on dir level supported
                        $dir = $outDir + '\' + $fileName.SubString(0, $fileName.IndexOf('\'))
                        if ([System.Io.Directory]::Exists($dir) -ne $true)
                        {
                            [System.Io.Directory]::CreateDirectory($dir)
                        }
                    }
                    #$fileName = "${outdir}\${fileName}"
                    $fileName = $outdir+"\"+$file+"\$filename" #ADDED
                }
                Write-Host "`t$fileName"
                $fs = [system.io.file]::Create($fileName)
                $streams[$stream].WriteTo($fs)
                $fs.Close()
            }
        }
    }
}

The above script is pretty much the same as Stefan Stranger’s script just without the unsealing MPs stuff (as we have covered this earlier).

That’s it for now. Happy hacking Winking smile

Stefan
http://www.code4ward.net

By Stefan Koell on Friday, July 06, 2012 1:57:06 PM

Since the release of System Center 2012, there has been a bit of confusion about the authoring options to create your own management packs. The biggest problem with the System Center release was, that there were new authoring tools announced but they were not released until recently – a couple of weeks later after the System Center release.

The most frustrating part about authoring is to get started. First you need find out how to google/bing to get the Authoring toolset and then when you know, it’s still not easy to locate all your needed downloads. MS provides a great new Technet space with Wikis and Galleries, really a gold mine of information, but still, not easy to get all the tools for authoring.

So in the spirit of the famous “authoring Friday”, this post is my personal bookmark collection of all relevant downloads and tools needed for authoring. I will briefly discuss all the available options and hopefully this might be also helpful to get you started…


“Out of the box” – Authoring Options

Technically speaking, you do not really need authoring tools to create management packs. Two options are available without using any tools:

Authoring space in the Operations Console

Using the authoring space you can do a lot of things for your daily operational needs. You can create overrides, monitors or rules from a list huge list of available easy-to-use wizards. There are also a lot of monitoring templates which helps you to create more complex monitoring for Windows Services, Web Applications, TCP ports, etc.

Also see Technet’s Authoring Guide for SCOM 2012 for more information.

XML Editor / Notepad

Since a management pack is XML and basically just a matter of meshing up modules you can of course use an XML editor to create your own MPs. Don’t get me wrong, this isn’t a walk in the park and has a steep learning curve. Additionally this approach is error prone.

Also see MSDN’s Management Pack Development Kit for SCOM 2012 for more information.

 

The out-of-the-box option is a typical 80/20 (70/30 – you can argue about the exact ratio) solution provided by Microsoft. The offering is great and covers probably 80 (70 or whatever) percent of your needs but at some point you will reach the limit with the built-in options and need to look at different options…

auth1


Visio Management Pack Designer

When I first saw the Visio MP Designer I was initially kind of “underwhelmed” by it and thought more of it as a “toy” but after I’ve seen some demonstration, I have to say it’s an easy and great experience which will take MP development for certain scenarios to a whole new level. You cannot cover all the scenarios with the designer but if the functionality of the provided shapes are sufficient for your scenario, it’s a great way to create a monitoring management pack for SCOM 2007 R2 and SCOM 2012 (yes, the MPs created with the designer are compatible with 2007 R2).

Before you install and use the Visio Management Pack Designer, make sure you have the following installed:

* To design an MP you can use Visio 2010 Professional but if you want to “compile” (create) the actual management pack XML you need Visio 2010 Premium. So working in a team doesn’t really require everyone to install the Premium edition, just the one who compiles the MPs.

When you’ve installed the above, go to http://www.microsoft.com/en-us/download/details.aspx?id=30170 and download the Visio MP Designer.

Here’s the official Wiki page for the Visio Management Pack Designer with a couple of examples:
http://social.technet.microsoft.com/wiki/contents/articles/5235.visio-management-pack-designer-for-system-center-2012-operations-manager-en-us.aspx

I’ve been told that there’s also a way to create your own shapes but at this time there’s no example available on how to do it. The ability to create your own shapes will be very useful in the scenario where you have lots of in-house developed applications and application components. SCOM authors can easily just design an application architecture using the Visio designer based on their very own component shapes which include all the necessary monitoring logic.

auth2


Visual Studio Authoring Extension

For me personally this is the holy grail of MP authoring and I’m very happy what the awesome SCOM product team created here! Working with the VSAE (Visual Studio Authoring Extension) has the same requirements in terms of skillset and MP authoring knowledge as working with the Authoring Console or XML Editor but it has some really nice features and concepts which is more than helpful in most authoring scenarios. Have a look at Michel Kamp’s blog post about the top 10 reasons why the VSAE is awesome: http://michelkamp.wordpress.com/2012/06/17/10-reasons-not-to-use-the-visual-studio-authoring-extensions-vsae/

Before you install the VSAE you need to have Visual Studio 2010 installed. Note that the Express editions of Visual Studio will not be supported! After you’ve installed Visual Studio 2010, download and install the extension here: http://www.microsoft.com/en-us/download/details.aspx?id=30169

Here’s the official Wiki page for the VSAE: http://social.technet.microsoft.com/wiki/contents/articles/5236.visual-studio-authoring-extensions-for-system-center-2012-operations-manager-en-us.aspx

Once installed you will notice that you are not only able to author SCOM management packs, you can also create SCSM management packs. A bit confusing is the newly introduced terminology:

  • Operations Manager 2012 Add-On Management Pack:
    is used to create management packs containing features only available on SCOM 2012 (like Dashboards or when you use the new network monitoring modules).
  • Operations Manager Core Monitoring Management Pack:
    is used to create monitoring management packs which will import and work correctly on SCOM 2007 R2 and on SCOM 2012.
  • Service Manager 2012 Management Pack:
    is used for Service Manager MPs. I will post a dedicated blog post about this.

As shown in the Wiki page linked above you can not only create new MPs with this beast, you can also import your existing MPs and let the VSAE slice your MP in all the elements for further processing.

auth3


Authoring Console (from SCOM 2007 R2 Authoring Resource Kit)

I’ve used the Authoring Console quite a bit in the past and you can find a couple of tutorials on my blog and on many other sites about how to use the authoring console. Seeing the authoring improvements in the VSAE, I’m not very sad that the good old Authoring Console will be a thing of the past. Don’t get me wrong, it was very helpful, it had a couple of serious issues but you can still use the console for MP development. It could be a bit tricky getting the MP references right but all the MPs created with the authoring console are still compatible and can be imported and used in SCOM 2012 management groups.

The limit is quite clear here: features only available in 2012 (like Dashboards or the new network monitoring stuff) can not be utilized using the authoring console.

The Management Pack Authoring Guide can be found here: http://technet.microsoft.com/en-us/library/ee957010.aspx

The Authoring Resource Kit (containing the Authoring Console) can be downloaded from: http://www.microsoft.com/en-us/download/details.aspx?id=18222

auth4

Summary

I know, I’m not going deep on either of the above topics but the sole purpose of this blog post is to provide an overview of the available authoring options for System Center 2012 Operations Manager. It should be a “Getting started”-kind of blog post. I hope it’s useful for you… Happy authoring!

cheers,
Stefan
http://www.code4ward.net