Stefan Stranger's Weblog - Manage your IT Infrastructure

"People are strange when you're a stranger" (The Doors) Link to my personal Lifestream

December, 2008

  • OpsMgr Video Experiment: Ask About OpsMgr question

    Source: Pavleck.Net

    Jeremy started an OpsMgr Video Experiment called Ask About OpsMgr and I really like the idea.

    “I’ve been reading and hearing all over the place how complicated and difficult Operations Manager is. You’re half-right. It’s immensely complicated when compared to previous editions, and when it’s your first exposure to it. I’m aiming to change all that, and I’m trying it in a new medium - video! So watch the video below (Or if your firewall rules don’t prohibit it, go directly to the YouTube link) and post a video response asking me your question. Any question.

    I’ll do my best to answer it with the help of the OpsMgr Army and screencast it all!”

    So because I quite new to creating videos I installed my webcam software did some tests and create my first Ask About OpsMgr Video question! Sorry for not being a great actor yet:-)

    I’ve already some thoughts about how I would solve my question but maybe there are some other ways to do it.

    Merry Xmass and Happy New Year!

  • Debugging OpsMgr Scripts

    One of the great advantages of OpsMgr 2007 against MOM 2005 is that you can easily test OpsMgr 2007 scripts from the command prompt.

    Just go to the C:\Program Files\System Center Operations Manager 2007\Health Service State and open a command prompt.

    Type DIR /B /S *.vbs and you find all the scripts that are used on that specific agent. And if you have found your script to debug you can easily run it with cscript and see what happens.

    But what if a scripts needs some parameters? Most of the time these are GUIDS and how do you find the right parameters?

    A colleague of mine Dirk van Coeverden found an easy way to find these parameters.

    Let’s Look at the Operational Database Space Free (%) Monitor.


    This Monitor uses a vbscript GetOpsMgrDBPercentageFreeSpace.vbs which needs two parameters to work


    So if we want to debug this script we need two parameters; DatabaseServerName and DatabaseName.

    How do we find those parameters?

    First we need to go to the Authoring Pane in the Opsmgr Console and find the monitor which runs this script.


    Then we change the default timeout of the script to something smaller then the default with an override. Say 1 second.


    Now we have to wait for this monitor to run again and hopefully see that the script timeouts because of the lower timeout settings. And if the script runs longer than the timeout period an event 21402 – Script ran longer than the timeout period will be created.


    Now you can debug the script from the commandprompt with the correct parameters. Don’t forget to remove the overrides.


  • Blog This in Windows Live Writer

    I got a question about Windows Live Writer from Rod Trent and when investigating this question I found that you can easily create blog posts when you are in Internet Explorer.

    How? Just go to Tools and click on Blog This in Windows Live Writer. This should also work in IE7.


  • New Systems Center Operations Manager 2007 SP1 Documentation

    Source: Microsoft Download Center

    Quick Details

    Version: 1.7

    Date Published: 12/19/2008

    Language: English

    Download Size: 221 KB - 5.4 MB*

    *Download size depends on selected download components.


    This download contains the following documentation for System Center Operations Manager 2007:

    • Operations Manager 2007 Operations Guide:
      This guide is a comprehensive resource that can be used to understand and use your Operations Manager 2007 implementation to your best advantage. It teaches the Operations Manager administrator what to do after successfully deploying Operations Manager for the first time as well as serving as a reference for ongoing maintenance.
    • Operations Manager 2007 Deployment Guide:
      This guide steps you through the deployment process for System Center Operations Manager 2007.
    • The Operations Manager 2007 Design Guide:
      This guide takes the reader through the necessary steps to develop a complete architectural plan for their OpsMgr2007 implementation.
    • Operations Manager 2007 Migration Guide:
      This guide is intended to help you understand the migration process from Microsoft Operations Manager 2005 (MOM 2005) to Operations Manager 2007 and the tools that are used in the process.
    • Operations Manager 2007 Report Authoring Guide:
      This guide provides an overview of the Operations Manager reporting feature, including procedures for generating pre-populated reports and authoring custom reports. There is also reference information for users looking to create custom reports.
  • Secure Vantage ACS Resource Kit v1.1

    Source: Secure Vantage Weblog

    Secure Vantage has released an update to the ACS Resource Kit for the community.

    The ACS Resource Kit now includes a revised version of the ACS Disk Planning Calculator originally posted on System Center Forum, new database utilities for ad-hoc queries and advanced grooming, plus the ACS Visio Stencils previously posted on our blog.

    For more information and to download the latest version of the ACS Resource Kit please visit

    ACS Resource Kit v1.1, Contents

    1. ACS Administrators Quick Reference – ACS newbie cheat sheet of common commands and configurations
    2. ACS Database and Disk Planning Calculator – preplan online, offline and archive storage needs plus disk requirements for the online audit database
    3. ACS Database Event Analysis
      • ACS Summary Stats - XLS you can connect to ACS DB for event load analysis
      • Query Active Partition for Event Counts
      • Query Active Partition for Specific Events
      • Windows Security Auditing Reference List – List of windows security events, settings and common configuration items for Windows XP, Vista, Windows Server 2003 & 2008
    4. ACS Database Utilities
      • Groom Specific Events from Audit Historical Database
    5. ACS Noise Filtering
      • ACS Noise Filter Guide
      • My Generic Filter – Sample noise filter
      • Filter Setup Kit – Auto apply generic filter sets after ACS installation
    6. ACS Security Event Creation Testing – Scripts to create events for over 50 audit scenarios
    7. ACS Visio Stencils – Microsoft Office Visio Stencils of common ACS components
  • Repost: Programmatically Check for Management Pack updates in OpsMgr 2007 R2

    Repost ;-) In the Twitter world we use Retweet if you post the tweet of someone else. So why not do it with blogposts ;-) That way you can easy filter on subject.

    My colleague Daniele Muscetta has posted an great article about using PowerShell to Check for updates in OpsMgr 2007 R2. I wish had found out how to do this, but you can learn a lot from this article.

    Remember that this is just SAMPLE code, it is not meant to be used in production environment and it is worth mentioning again that OpsMgr2007 R2 this is BETA software at the time of writing, therefore this functionality (and its implementation) might change at any time, and the script will break. Also, at present, the MP Catalog web service still returns slightly older MP versions and it is not yet kept in sync and updated with MP Releases, but it will be ready and with complete/updated content by the time R2 gets released.

  • Answer: Operations Manager Authoring questions from SQLBatman

    I saw a question of SQLBatman about Operations Manager Authoring.

    Here my attempt to answer those questions.

    Q: Referenced MP could not be found

    A: Search on your (Root) Management Server for *.mp files and copy all these files to one directory, like c:\Mps.  If your Authoring Console is on another machine then your (Root) Management Server copy these files to this machine.

    Add this directory to the References in Options

    Q: Create a custom attribute to the SQL DB Engine

    A: I only found that there are only two WMI Providers for Microsoft SQL Server 2005: WMI Provider for Configuration Management and WMI Provider for Server Events.
        Source: Microsoft Windows PowerShell and SQL Server 2005 WMI Providers – Part 1 and Microsoft Windows PowerShell and SQL Server 2005 WMI Providers - Part 2

        I’ve to look for more info about this question, but I at the moment I don’t have much time. But I’ll try to look into this soon.

  • Old Blog post about Compiling commandline application for Creating and Updating Groups

    Marco Shaw published a blogpost about and Advanced example using PowerShell and the OpsMgr SDK: Creating and Updating Groups and mentioned an old blog post from me which he could not find anymore.

    Here is that blog post from me (without the pictures)

    Compiling commandline application for Creating and Updating Groups

    Mon, 22/10/2007 - 21:32 — Stefan

    Today I saw a question from Marco Shaw in the MyITForum MOM maillist about how to compile the code from Jakub Oleksy where he explains how you can use the OpsMgr SDK to create and update groups in OpsMgr.

    In this article is demonstrate how I was able to compile that code to create a commandline tool. Keep in mind I'm not a programmer, just trying to get some knowledge about creating tools using the OpsMgr SDK. If you are looking for real great tools for OpsMgr visit Boris Yanushpolsky website ;-)

    Install Compiler
    First I downloaded Snippet Compiler (why download and install Visual Studio Express if you only need to compile the code?). After the download just unzip the files and you are ready to run the Snippet Compiler.

    Install OpsMgr SDK
    Check if you have installed the OpsMgr SDK. If not you can download the SDK from the Microsoft Connect site on the System Center Operations and Service Management downloads after you registered.

    Add OpsMgr SDK references
    After starting the Snippet Compiler you first have to add the OpsMgr SDK References.

    Go to Tools->References and select the Microsoft.EnterpriseManagement.OperationsManager.Common.dll and Microsoft.EnterpriseManagement.OperationsManager.dll from the SDK as refrerence in Snippet Compiler.
    Click on OK.

    Change the code from Jakub Olesky
    The code Jakub has provided will not work on it's own, but you can use it to create a commandline tool. I changed the code (bold and larger fonts) slightly to create a console app. But you can add more arguments if you want, it's just for the learning.

    namespace Jakub_WorkSamples
    	using System;
    	using Microsoft.EnterpriseManagement;
    	using Microsoft.EnterpriseManagement.Configuration;
    	using Microsoft.EnterpriseManagement.ConnectorFramework;
    	using Microsoft.EnterpriseManagement.Monitoring;
    	internal class Program
    	private static void Main(string[] args)
    	    Console.WriteLine("CreateGroups - Version 1.0 - Compiled October 22, 2007");
                if (args.Length < 1)
                    Console.WriteLine("Provide name Root Management Server");
                    Console.WriteLine(@"ex: CreateGroups.exe RMSServer01");
    				string strRMS = args[0];
    				Console.WriteLine("Connect to Root Management Server:" + strRMS);
    				// Connect to the sdk service on the local machine
    				ManagementGroup localManagementGroup = new ManagementGroup(strRMS);
    				string formula =	
    				// Create the custom monitoring object group	
    				CustomMonitoringObjectGroup allComputersGroup =	
    					new CustomMonitoringObjectGroup("Jakub.At.Work.Namespace",	
    					"Jakub@Work Sample All Computers Group",	
    				// Get the default management pack.	
    				ManagementPack defaultManagementPack =	
    				// Get the management packs for references	
    				ManagementPack windowsManagementPack = localManagementGroup.	
    				ManagementPack instanceGroupManagementPack = localManagementGroup.	
    				ManagementPackReferenceCollection newReferences = 	
    					new ManagementPackReferenceCollection();
    				newReferences.Add("Windows", windowsManagementPack);	
    				newReferences.Add("InstanceGroup", instanceGroupManagementPack);
    				// Get the class that represents my new group	
    				MonitoringClass myNewGroup = localManagementGroup.	
    				// Get the discovery rule that populates this group	
    				// For the purposes of this sample, I know there is only 1 in the template	
    				MonitoringDiscovery groupPopulateDiscovery = myNewGroup.	
    				// This is the full configuration of the discovery of which the 	
    				// membership rule is one part that you can configure and update	
    				Console.WriteLine("The discovery configuration: {0}",	
    				// Update the configuration in some fasion	
    				string newConfiguration =	
    				// Now we want to update the group membership for this group	
    				groupPopulateDiscovery.Status = ManagementPackElementStatus.PendingUpdate;	
    				groupPopulateDiscovery.DataSource.Configuration = newConfiguration;	

    Copy to code into Snippet Compiler
    Now you have to copy the code from above to the Snippet Compiler and Select Build Current to file. Give it a nice name (CreateGroups.exe) and save it as Console EXE. Or you can download the code from here and import it in the Snippet Compiler.

    After you compiled the CreateGroups.exe commandline tool and copied it to the RMS you can run it with the next command: CreateGroups.exe localhost. When the console app is finished a new Group Jakub@Work Sample All Computers Group is created with "Windows Computer" as Members.

    Just change the code if you want to change the name of the Group or the formula to populate the group.

  • New blog to add to your blogroll

    Jose Rodas works at Microsoft as a Senior Support Engineer in the System Center Support Team and started to blog and will be focused in Service Management products.

    Add his blog to your blogroll if you need more blogs to follow ;-).

  • Generating an Alert after service being stopped n-times within certain time


    The Windows NT Service of a buggy application crashes regularly and is restarted automatically with an Recovery Task.

    You only want to receive an Alert if this happens n-times within a specified time.


    1. Create a Basic Service Monitor which does not generate an Alert.
    2. Create a Recovery Task for the Basic Service Monitor in Step 1.
    3. Create a Windows Event Repeated Event Detection Monitor.


    Step 1. Create a Basic Service Monitor which does not generate an Alert

    Just create a ‘normal’ Windows Service Monitor.


    Step 2. Create a Recovery Task for the Basic Service Monitor in Step 1.





    Change working directory to %windir%


    Tip: On Windows 2000 servers there isn't being logged that a service is stopped in the System Eventlog. Create another Recovery Task which creates an Eventlog if the service is stopped. You can use the LOGEVENT tool in the Windows 2000 Server Reskit if you want.

    Step 3. Create a Windows Event Repeated Event Detection Monitor.






    Configure the EventID which shows that a service is being stopped. Or use your own created Windows NT EventID on a Windows 2000 server.


    Configure the Repeat Settings for your environment.

    Info from the OpsMgr Helpfile.





    Enable the monitor with an Override for the correct computers.