• Stefan Stranger's Weblog - Manage your IT Infrastructure

    Vyatta Virtual Router on Hyper-V

    • 5 Comments
    I’m currently building a new demo/test environment on my Windows Server 2008 Hyper-V server. And I wanted to have a Virtual Router running on Hyper-V which should handle the routing between the virtual networks on Hyper-V.

    First some background info on my network at home.

    image

    So I looked for a software router which could be installed as a guest on my Hyper-V host. I started with BrazilFW, but I had trouble to get the Gateway and DNS running (failed) although a colleague was able to get BrazilFW running on Hyper-V by upgrading the SYSLINUX (bootloader for Linux). Then I tried Freesco and m0n0wall, but both would not start on Hyper-V. So I finally found Vyatta via SourceForge.

    Vyatta is a Linux-based, open network operating system that integrates advanced enterprise-class routing, security, bandwidth management and more. Vyatta runs on standard x86 hardware, VMWare & Xen and offers config via Linux-shell, CLI and web GUI.

    It runs on VMWare & Xen so why would not it run on Hyper-V? And I was correct it runs great on Hyper-V ;-) These are steps I’ve taken to get it running on Hyper-V.

    1. Downloading ISO image from Vyatta’s website
      Vyatta Community Edition 4.0 (VC4)
    2. Create a new Virtual Machine in Hyper-V Manager
      Attach the ISO downloaded in step 1 to the new Vyatta Virtual Machine so it can boot from the ISO.
    3. Configure the Vyatta Virtual Machine
      Add the Network Adapters for the Internet, and the needed subnets to Vyatta Virtual Machine.
      Remark: Use Legacy Network Adapters!
      image

      I added a 1 GB harddisk and gave it 128 MB RAM.
    4. Installing Vyatta
      You can boot from the ISO you downloaded in step 1.  because it’s also a “Live CD”
      You’ll first need to login to Vyatta once it’s booted up. The default logins are (user: root pass: Vyatta) To install to the drive you will issue the command:
      install-system
      During the install you will be asked how much diskspace to allot to the different partitions. I went with the default. Once that’s complete, pop the CD out, and reboot to your installed Vyatta. Now we can start configuring the system.
    5. Configuring Ethernet Interfaces
      Log on the system.
      Configure the first NIC (eth0) which is going to be used for Internet access.

      eht0:

      vyatta@vyatta> configure
      [edit]
      vyatta@vyatta# set interfaces ethernet eth0 address 192.168.1.254/24
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta# exit
      exit
      vyatta@vyatta>


      eth1:

      vyatta@vyatta> configure
      [edit]
      vyatta@vyatta# set interfaces ethernet eth1 address 192.168.2.254/24
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta# exit
      exit
      vyatta@vyatta>


      eth2:

      vyatta@vyatta> configure
      [edit]
      vyatta@vyatta# set interfaces ethernet eth2 address 192.168.3.254/24
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta# exit
      exit
      vyatta@vyatta>

      Check interfaces configuration:

      vyatta@vyatta:~$ configure
      [edit]
      vyatta@vyatta# show interfaces ethernet
      eth0 {
           address 192.168.1.254/24
           description Internet
           hw-id 00:15:5d:00:01:22
      }
      eth1 {
           address 192.168.2.254/24
           description "subnet1:MOM 2005"
            hw-id 00:15:5d:00:01:23
      }
      eth2 {
           address 192.168.3.254/24
           description "subnet2:OPSMGR 2007"
      }


    6. Save Configuration

      vyatta@vyatta# save
      Saving configuration to
      '/opt/vyatta/etc/config/config.boot'...
      Done
      [edit]


    7. Configuring Access to a DNS Server

      vyatta@vyatta# set system name-server 192.168.1.1
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta#


    8. Specifying the Default Gateway

      vyatta@vyatta# set system gateway-address 192.168.1.1
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta#


    9. Configuring the Firewall
      We want to block the traffic from subnet1 to subnet2 and visa-versa.
      Firewall block-subnet1 rules:

      vyatta@vyatta# set firewall name block-subnet1
      [edit]
      vyatta@vyatta# set firewall name block-subnet1 rule 1
      [edit]
      vyatta@vyatta# set firewall name block-subnet1 rule 1 source address 192.168.2.0/24
      [edit]
      vyatta@vyatta# set firewall name block-subnet1 rule 1 action drop
      [edit]
      vyatta@vyatta# set firewall name block-subnet1 rule 2
      [edit]
      vyatta@vyatta# set firewall name block-subnet1 rule 2 action accept
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta#

      Do the same for subnet2.

      vyatta@vyatta# set firewall name block-subnet2
      [edit]
      vyatta@vyatta# set firewall name block-subnet2 rule 1
      [edit]
      vyatta@vyatta# set firewall name block-subnet2 rule 1 source address 192.168.3.0/24
      [edit]
      vyatta@vyatta# set firewall name block-subnet2 rule 1 action drop
      [edit]
      vyatta@vyatta# set firewall name block-subnet2 rule 2
      [edit]
      vyatta@vyatta# set firewall name block-subnet2 rule 2 action accept
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta#


    10. Apply the rule set to an interfaces
    11. vyatta@vyatta# set interfaces ethernet eth1 firewall out name block-subnet2
      [edit]
      vyatta@vyatta# set interfaces ethernet eth2 firewall out name block-subnet1
      [edit]
      vyatta@vyatta# commit
      [edit]
      vyatta@vyatta#

    Final configuration:

    vyatta@vyatta:~$ show configuration
    firewall {
        name block-subnet1 {
            rule 1 {
                action drop
                source {
                    address 192.168.2.0/24
                }
            }
            rule 2 {
                action accept
            }
        }
        name block-subnet2 {
            rule 1 {
                action drop
                source {
                    address 192.168.3.0/24
                }
            }
            rule 2 {
                action accept
            }
        }
        name block-subnet3 {
            rule 1 {
                action drop
                source {
                    address 192.168.2.0/24
                }
            }
            rule 2 {
                action accept
            }
            rule 3 {
                action drop
                source {
                    address 192.168.3.0/24
                }
            }
        }
    }
    interfaces {
        ethernet eth0 {
            address 192.168.1.254/24
            description Internet
            hw-id 00:15:5d:00:01:22
        }
        ethernet eth1 {
            address 192.168.2.254/24
            description "subnet1:MOM 2005"
            firewall {
                out {
                    name block-subnet2
                }
            }
            hw-id 00:15:5d:00:01:23
        }
        ethernet eth2 {
            address 192.168.3.254/24
            description "subnet2:OPSMGR 2007"
            firewall {
                out {
                    name block-subnet1
                }
            }
            hw-id 00:15:5d:00:01:24
        }
        loopback lo {
        }
    }
    service {
        nat {
            rule 1 {
                outbound-interface eth0
                source {
                    address 192.168.2.0/24
                }
                type masquerade
            }
            rule 2 {
                outbound-interface eth0
                source {
                    address 192.168.3.0/24
                }
                type masquerade
            }
        }
        ssh {
        }
    }
    system {
        gateway-address 192.168.1.1
        login {
            user root {
                authentication {
                    encrypted-password ****************
                }
            }
            user vyatta {
                authentication {
                    encrypted-password ****************
                }
            }
        }
        name-server 192.168.1.1
        ntp-server 69.59.150.135
        package {
            repository community {
                components main
                distribution stable
                url http://packages.vyatta.com/vyatta
            }
        }
    }
    vyatta@vyatta:~$

    Don’t forget to save your configuration!

    Now you are done! Check out the documentation for Vyatta before starting. I used the QuickStart and the Command Reference.

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    OpsMgr 2007: Parameters Explained

    • 7 Comments

    Some time ago I showed you can use PowerShell to create Events for OpsMgr 2007. And according to the comments quite some people have questions about Event parameters. After creating the first version of the PowerShell Create Events for OpsMgr 2007 script, Ken added some functionality and one was modifying the question to not only add a EventLog Description but also a EventLog Parameter.

    I found some info on MOM 2005 parameters on Rory McCaw’s weblog, but except that article I could not find much info on Event Log parameters. So hopefully this will explain what parameters are and how they can be used in OpsMgr 2007.

    EventLog Parameters in the Events

    Every Windows event has description text that is filled in by the values of different parameters. You can find the Eventlog parameters of an event by using the Log Parser. (if you know an easier way on Windows 2003 Servers let me know). Log parser is a powerful, versatile tool that provides universal query access to text-based data such as log files, XML files and CSV files, as well as key data sources on the Windows® operating system such as the Event Log, the Registry, the file system, and Active Directory®.

    Example of EventLog Parameters in an Eventlog:

    C:\Program Files\Log Parser 2.2>LogParser.exe "SELECT Top1 Strings AS Parameters FROM Application WHERE EventID=301"

    Result:
    image_thumb

    So in this example you can use four parameters in your OpsMgr Rules or Monitor.

    Event Parameters in OpsMgr 2007

    Eventlog Parameters can be used in OpsMgr Rules and Monitors. An example where you can find EventLog Parameters used is the Windows Activation State Monitor in the Windows Server 2003 MP. This is a 3 State Event Log Monitor and this monitor looks for EventLog Parameters and the values found in the Eventlog change the state of the monitor.

    Healthy:    Look for EventId 1006 in Application Log of Source Windows Product Activation
    Warning: Look for EventId 1005 in Application Log of Source Windows Product Activation and Params/Param[1] > 6 =< 15
    Critical:   Look for EventId 1005 in Application Log of Source Windows Product Activation and Params/Param[1] =< 6

    image_thumb10

    You can use the PowerShell Create Events script from Ken to test your monitors or rules with with one EventLog parameter. So it won’t work if you need to test a Rule or Monitor which uses more than one parameter in the Eventlog.

    So if you want to test the Windows Activation State Monitor and want to Change the State to Critical, you need to create an Event with the next values:

    EventID 1005
    Source Windows Product Activation
    Type Error
    Description Your Windows product has not been activated with Microsoft yet. Please use the Product Activation Wizard within <number> days.

    More info about this event can be found on EventID.Net

    image

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    The failure code on the certificate was 0x800B010A (A certificate chain could not be built to a trusted root authority.)

    • 1 Comments

    Last week I was helping a customer with some OpsMgr certificate issues with their monitoring Agents in a non-trusted domain. More info on Monitoring an Agent in a non-trusted domain can be found here: http://blogs.technet.com/smsandmom/archive/2008/09/10/opsmgr-2007-monitoring-an-agent-in-a-non-trusted-domain.aspx

    These were the events in the OperationsManager Eventlog:

    Event Type:       Warning
    Event Source:   OpsMgr Connector
    Event Category:               None
    Event ID:             20067
    Date:                    6/17/2009
    Time:                    3:33:31 PM
    User:                    N/A
    Computer:         computername
    Description:
    A device at IP 192.168.1.1:5723 attempted to connect but the certificate presented by the device was invalid.  The connection from the device has been rejected.  The failure code on the certificate was 0x800B010A (A certificate chain could not be built to a trusted root authority.).

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Event Type:       Warning
    Event Source:   OpsMgr Connector
    Event Category:               None
    Event ID:             21002
    Date:                    6/17/2009
    Time:                    3:33:31 PM
    User:                    N/A
    Computer:         computername
    Description:
    The OpsMgr Connector could not accept a connection from 192.168.1.1:5723 because mutual authentication failed.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Event Type:       Error
    Event Source:   OpsMgr Connector
    Event Category:               None
    Event ID:             20070
    Date:                    6/17/2009
    Time:                    3:33:31 PM
    User:                    N/A
    Computer:         computername
    Description:
    The OpsMgr Connector connected to MS01.support.local, but the connection was closed immediately after authentication occurred.  The most likely cause of this error is that the agent is not authorized to communicate with the server, or the server has not received configuration.  Check the event log on the server for the presence of 20000 events, indicating that agents which are not approved are attempting to connect.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.

    Event Type:       Error
    Event Source:   OpsMgr Connector
    Event Category:               None
    Event ID:             21016
    Date:                    6/17/2009
    Time:                    3:33:33 PM
    User:                    N/A
    Computer:         computername
    Description:
    OpsMgr was unable to set up a communications channel to MS01.support.local and there are no failover hosts.  Communication will resume when MS01.support.local is available and communication from this computer is allowed.

    For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp

    So it was clear the agent could not communicate with the Management Server in the un-trusted domain using certificates. So we needed to check if the certificates were ok. And in this case it turned out that Certutil was our friend ;-). Certutil.exe is a command-line program that is installed as part of Certificate Services in the Windows Server 2003 family (and higher). Here are the steps we took to verify that there was certificate issue and how we solved it.

    Issue:
    Agent needing a certificate to communicate with Management Server are generating “A certificate chain could not be built to a trusted root authority” event ids (20067, 20070,  21016)  errors in the Operations Manager eventlog.

    Reason:
    Wrong proxy settings, so the (Intermediate) Root CA could not be contacted.

    See next line in output from certutil -urlfetch -verify <cert.cer> tool:

    Failed "AIA" Time: 0
    Error retrieving URL: The server name or address could not be resolved 0x80072ee7 (WIN32: 12007)
    http://cert.domain.local/aia/SUPPORT.WEB%20ROOT%20CA.crt

    Complete output from certutil see attachment certutil_output.txt

    Steps to solve issue:

    1. Check for eventids (20067, 20070,  21016)
    2. Export certificate from Local\Computer\Personal\Certificate Folder
      Save as DER encoded binary X.509 (.CER) file.
    3. Run certutil -urlfetch -verify <cert.cer> tool on cer file exported in step 2.
    4. Search certutil output for errors, like “retrieving URL: The server name or address could not be resolved 0x80072ee7 (WIN32: 12007)”
    5. Open Internet Explorer and copy URL that cannot be resolved. If you cannot download the *.crt file look at your proxy settings. These should be empty of correct.
    6. Correct proxy settings.
    7. [not sure if step 7 is really needed] Remove certificates from Local\Computer\Personal\Certificate Folder and Local\Computer\Operations Manager\Certificate folder
    8. Import certificate again in Local\Computer\Personal\Certificate folder
      You can run certutil -urlfetch -verify <cert.cer> tool again to see if there are still any errors.
    9. Run MomCertImport <nameofcertexport>.pfx again.
    10. Check eventlog for restart of HealthService (will be restarted after running MOMCertImport) and if everything is ok now ;-)
  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Monitoring non-domain members with OM 2012

    • 5 Comments

    While the rest of the System Center community is in Vegas for MMS2012 I’m helping customers with their questions about System Center Operations Manager 2012. To be honest I’m little jealous on all the people who are in Vegas right now. Winking smile 

    So I created some more detailed documentation on how to start monitoring your non-domain members (workgroup servers in your DMZ) in  OM2012.

    It are still the same steps as in OM 2007 so if you already familiar with those steps it would be easy for you.

    I created a simple Diagram to have a high-level overview on which steps are being executed on which machines.

    Certificates_Workflow

      Environment:

      • OM12 RTM
      • Stand-Alone Windows Server 2008 CA (w2k8r2dc1.demo.stranger)
      • Two OM12 Management Servers (OM12MS01.demo.stranger and OM12MS02.demo.stranger)
      • Workgroup server in "DMZ" (OM12DMZ01.demo.dmz)

      Some important notes:

      • Server must have a FQDN, so if it is in a workgroup add a domain suffix manually.
      • The server being monitored must be able to resolve the FQDN of the OM2012 Management Server server.
      • Check if non-domain member server can connect to port 5723 from Management Server. (use telnet client)

      Guide info: http://technet.microsoft.com/en-us/library/dd362655.aspx

      Pre-reqs:

      It is assumed that you have AD CS installed, an HTTPS binding is being used, and its associated certificate has been installed. Information about creating an HTTPS binding is available in the topic How to Configure an HTTPS Binding for a Windows Server 2008 CA.

       

      High-Level steps:

    1. Download the Trusted Root (CA) certificate.
    2. Import the Trusted Root (CA) certificate
    3. Create a setup information file to use with the CertReq command-line utility.
    4. Create a request file.
    5. Submit a request to the CA using the request file.
    6. Approve the pending certificate request.
    7. Retrieve the certificate from the CA.
    8. Import the certificate into the certificate store.
    9. Import the certificate into Operations Manager using MOMCertImport.

      Step 1. Download the Trusted Root (CA) certificate

      • Log on to the computer where you installed a certificate; for example, the gateway server or management server.
      • Start Internet Explorer, and connect to the computer hosting Certificate Services; for example, https://<servername>/certsrv.
      • On the Welcome page, click Download a CA Certificate, certificate chain, or CRL.
      • On the Download a CA Certificate, Certificate Chain, or CRL page, click Encoding method, click Base 64, and then click Download CA certificate chain.
      • In the File Download dialog box, click Save and save the certificate; for example, Trustedca.p7b.
      • When the download has finished, close Internet Explorer.

      [OM12MS02.demo.stranger]

      Download a CA Certificate, certificate chain, or CRL

      clip_image002

      clip_image003

      clip_image004

      clip_image005

      Step 2. Import the Trusted Root (CA) Certificate

      • On the Windows desktop, click Start, and then click Run.
      • In the Run dialog box, type mmc, and then click OK.
      • In the Console1 window, click File, and then click Add/Remove Snap-in.
      • In the Add/Remove Snap-in dialog box, click Add.
      • In the Add Standalone Snap-in dialog box, click Certificates, and then click Add.
      • In the Certificates snap-in dialog box, select Computer account, and then click Next.
      • In the Select Computer dialog box, ensure that Local computer: (the computer this console is running on) is selected, and then click Finish.
      • In the Add Standalone Snap-in dialog box, click Close.
      • In the Add/Remove Snap-in dialog box, click OK.
      • In the Console1 window, expand Certificates (Local Computer), expand Trusted Root Certification Authorities, and then click Certificates.
      • Right-click Certificates, select All Tasks, and then click Import.
      • In the Certificate Import Wizard, click Next.
      • On the File to Import page, click Browse and select the location where you downloaded the CA certificate file, for example, TrustedCA.p7b, select the file, and then click Open.
      • On the File to Import page, select Place all certificates in the following store and ensure that Trusted Root Certification Authorities appears in the Certificate store box, and then click Next.
      • On the Completing the Certificate Import Wizard page, click Finish.

      [OM12MS02.demo.stranger]

      Open Certificates Local Computer account MMC:

      clip_image006

      Import Certificate TrustedCA.p7b

      clip_image007

      clip_image008

      clip_image009

      Step 3. Create a setup information file to use with the CertReq command-line utility.

      • On the computer hosting the Operations Manager component for which you are requesting a certificate, click Start, and then click Run.
      • In the Run dialog box, type Notepad, and then click OK.
      • Create a text file containing the following content:
        [NewRequest]
        Subject="CN=<FQDN of computer you are creating the certificate, for example, the gateway server or management server.>"
        Exportable=TRUE
        KeyLength=2048
        KeySpec=1
        KeyUsage=0xf0
        MachineKeySet=TRUE
        [EnhancedKeyUsageExtension]
        OID=1.3.6.1.5.5.7.3.1
        OID=1.3.6.1.5.5.7.3.2
      • Save the file with an .inf file name extension, for example, RequestConfig.inf.
      • Close Notepad.

      [OM12MS02.demo.stranger]

      clip_image010

      Step 4. Create a request file to use with a stand-alone CA

      • On the computer hosting the Operations Manager component for which you are requesting a certificate, click Start, and then click Run.
      • In the Run dialog box, type cmd, and then click OK.
      • In the command window, type CertReq –New –f RequestConfig.inf CertRequest.req, and then press ENTER.
      • Open the resulting file (for example, CertRequest.req) with Notepad. Copy the contents of this file onto the clipboard.

      [OM12MS02.demo.stranger]

      clip_image011

      Step 5. Submit a request to a stand-alone CA

      • On the computer hosting the Operations Manager component for which you are requesting a certificate, start Internet Explorer, and then connect to the computer hosting Certificate Services (for example, https://<servername>/certsrv).
      • On the Microsoft Active Directory Certificate Services Welcome screen, click Request a certificate.
      • On the Request a Certificate page, click advanced certificate request.
      • On the Advanced Certificate Request page, click Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file.
      • On the Submit a Certificate Request or Renewal Request page, in the Saved Request text box, paste the contents of the CertRequest.req file that you copied in step 4 in the previous procedure, and then click Submit.
      • Close Internet Explorer.

      [OM12MS02.demo.stranger]

      Request a certificate

      clip_image012

      Advanced

      clip_image013

      Select Submit a certificate request by using a base-64-encoded CMC or PKCS #10 file, or submit a renewal request by using a base-64-encoded PKCS #7 file.

      clip_image014

      clip_image015

      clip_image016

      Step 6. approve the pending certificate request

      • Log on as a certification authority administrator to the computer hosting Active Directory Certificate Services.
      • On the Windows desktop, click Start, point to Programs, point to Administrative Tools, and then click Certification Authority.
      • In Certification Authority, expand the node for your certification authority name, and then click Pending Requests.
      • In the results pane, right-click the pending request from the previous procedure, point to All Tasks, and then click Issue.
      • Click Issued Certificates, and confirm the certificate you just issued is listed.
      • Close Certification Authority.

      [W2K8R2DC1.demo.stranger]

      Click Pending Request in Certificate Authority

      clip_image017

      Click on Issue

      clip_image018

      clip_image019

      Step 7. retrieve the certificate

      • Log on to the computer where you want to install a certificate; for example, the gateway server or management server.
      • Start Internet Explorer, and connect to the computer hosting Certificate Services (for example, https://<servername>/certsrv).
      • On the Microsoft Active Directory Certificate Services Welcome page, click View the status of a pending certificate request.
      • On the View the Status of a Pending Certificate Request page, click the certificate you requested.
      • On the Certificate Issued page, select Base 64 encoded, and then click Download certificate.
      • In the File Download – Security Warning dialog box, click Save, and save the certificate; for example, as NewCertificate.cer.
      • On the Certificate Installed page, after you see the message that Your new certificate has been successfully installed, close the browser.
      • Close Internet Explorer.

      [OM12MS02.demo.stranger]

      View status of pending certificate request

      clip_image020

      Save certificate

      clip_image021

      clip_image022

      Download certificate

      clip_image023

      clip_image024

      Step 8. import the certificate into the certificate store

      • On the computer hosting the Operations Manager component for which you are configuring the certificate, click Start, and then click Run.
      • In the Run dialog box, type cmd, and then click OK.
      • In the command window, type CertReq –Accept NewCertificate.cer, and then press ENTER

      [OM12MS02.demo.stranger]

      clip_image025

      Step 9. import the certificate into Operations Manager using MOMCertImport

      • Log on to the computer where you installed the certificate with an account that is a member of the Administrators group.
      • On the Windows desktop, click Start, and then click Run.
      • In the Run dialog box, type cmd, and then click OK.
      • At the command prompt, type <drive_letter>: (where <drive_letter> is the drive where the Operations Manager 2007 installation media is located), and then press ENTER.
      • Type cd\SupportTools\i386, and then press ENTER.

      clip_image026

      Note

      On 64-bit computers, type cd\SupportTools\amd64

      • Type the following:
        MOMCertImport /SubjectName <Certificate Subject Name>
      • Press ENTER.

      [OM12MS02.demo.stranger]

      MOMCertImport /SubjectName OM12MS02.demo.stranger

      clip_image027

      Check if everything is ok

      Open the certificate that you installed on management/gateway server. Click on Details Tab and check the Serial Number.

      Now navigate to HKLM\Software\Microsoft\Microsoft Operations Manager\3.0\Machine Settings and check the value of ChannelCertificateSerialNumber. Serial number of certificate should be listed backwards here in registry.

      clip_image028

      clip_image029

      Open registry

      clip_image030

      clip_image031

      Tada!

      Pre-reqs on DMZ server:

      Make sure you have installed the OM12 Agent first before starting.

       

      clip_image039

       

      Let's check the eventlog

      clip_image041

      Repeat steps for OM12DWZ01 server in workgroup

      High-Level steps:

      • Download the Trusted Root (CA) certificate.
      • Import the Trusted Root (CA) certificate
      • Create a setup information file to use with the CertReq command-line utility.
      • Create a request file.
      • Submit a request to the CA using the request file.
      • Approve the pending certificate request.
      • Retrieve the certificate from the CA.
      • Import the certificate into the certificate store.
      • Import the certificate into Operations Manager using MOMCertImport.

      [OM12DWZ01.demo.dmz]

      Step 1. Download the Trusted Root (CA) certificate.

      clip_image042

      clip_image043

      Step 2. Import the Trusted Root (CA) certificate

      clip_image044

      Step 3. Create a setup information file to use with the CertReq command-line utility.

      clip_image045

      Step 4. Create a request file to use with a stand-alone CA

      CertReq –New –f RequestConfig.inf CertRequest.req

      clip_image046

      Step 5. Submit a request to a stand-alone CA

      clip_image047

      clip_image048

      Step 6. approve the pending certificate request

      [W2K8R2DC1.demo.stranger]

      clip_image049

      clip_image050

      Step 7. retrieve the certificate

      [OM12DMZ01.demo.dmz]

      clip_image051

      clip_image052

      Step 8. import the certificate into the certificate store

      clip_image053

      Step 9. import the certificate into Operations Manager using MOMCertImport

      MOMCertImport /SubjectName OM12DMZ01.demo.dmz

      clip_image054

      Final step is approving agent

      Check Security Settings in Operations Console.

      clip_image055

      clip_image056

      Wait for Agent to turn up in Pending Approval folder

      clip_image057

      clip_image058

      End result:

      clip_image059

     

    Have fun at MMS for those who are in Vegas, and for those who are not, well…

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    OpsMgr SQL Full or Differential Backup Check

    • 7 Comments

    I helped a customer creating a OpsMgr Monitor for checking if the there has been a SQL Full or Differential Backup within a specified number of hours. David Scheltens created the SQL query.

    Remark: Please read information on System Center Central for more info on this article.

    This is how you could create this kind of monitor in your own environment.

    Steps:

    1. Create a Timed Script Two State Monitor.
    2. Save Monitor in other MP than Default MP.
    3. Give the Monitor a Name, like “Custom – SQL Full or Differential Backup Check”.
    4. Target the Monitor to SQL Database.
    5. Select a suitable Parent Monitor like Availability.
    6. Disable Monitor (enable by an Override later).
    7. Configure how often this Monitor should run (default is 15 mins, but you could change this depending on the time your SQL backups run)
    8. Copy script from here.
      The script uses three parameters (or arguments)
      - Param 0: The SQL connection string for the server
      - Param 1: The Database to use
      - Param 2: The threshold (in hours) to use
    9. Configure the Parameters.
       image 
    10. Configure Unhealthy Expression.
      Property[@Name='NumHours'] Greater Than 1 (threshold when your backup should have been run)
      image
    11. Configure Healthy Expression
      Property[@Name='NumHours'] Less than or equal to 1 (threshold when your backup should have been run)
      image
    12. Configure Health.
      image
    13. Configure Alerting
      I used the Reason, BackupType and Number of Hours in the Alert Description.

      image
    14. Open the MP XML file and change the data type in the xml configuration from string to integer. Since making this change, the alerts and state changes seems to occur when at the correct time.
      More info here: (thanks to Daniele Grandini)
      <ErrorExpression>

                <SimpleExpression>

                  <ValueExpression>

                    <XPathQueryType="Integer">Property[@Name='NumHours'] </XPathQuery>

                  </ValueExpression>

                  <Operator>Greater</Operator>

                  <ValueExpression>

                    <ValueType="Integer">20</Value>

                  </ValueExpression>

                </SimpleExpression>

              </ErrorExpression>

              <SuccessExpression>

                <SimpleExpression>

                  <ValueExpression>

                    <XPathQueryType="Integer">Property[@Name='NumHours'] </XPathQuery>

                  </ValueExpression>

                  <Operator>LessEqual</Operator>

                  <ValueExpression>

                    <ValueType="Integer">20</Value>

                  </ValueExpression>

                </SimpleExpression>

              </SuccessExpression>

    15. Enable the Monitor via an Override.

    Remark: You may need to Use a Run As Account with the right permission for this Monitor.

    Result:

    clip_image002

     

    Some time ago I created a Tutorial How to Associate a Run As Account to a Monitor.

     

    In Operations Manager 2007, Run As Profiles and Run As Accounts are used to select users with the privileges needed for running rules, tasks, and monitors. Management Pack authors create a rule, task, or monitor, and then associate it with a Run As Profile. The named Run As Profile is imported along with the Management Pack into Operations Manager 2007.

    The Operations Manager 2007 administrator creates a named Run As Account and specifies users and groups. The administrator then adds the Run As Account to the Run As Profile and specifies the target computers that the account should run on.

    The goal in this short tutorial is to create a Timed Script Two State Monitor and associate a run as account to this monitor and save it all in a Management Pack. The Timed Script Two State Monitor is a vbscript that uses WMI to check if BizTalk orchestrations are not started.

    I’ve got some great help from Jakub Oleksy (http://blogs.msdn.com/jakuboleksy/default.aspx) and Steve Wilson (http://www.authormps.com/dnn/)

    You can download the tutorial here.

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Update: Put OM2012 Computer Group Members in Maintenance Mode with PowerShell

    • 26 Comments

    I finally found out the issue why this script was not working for everybody. It was because of the different versions of PowerShell. Now it should also work on PowerShell v2.

    Another possible fix to the empty ComputerGroupsMembernames issue.

    Last week I saw a request for a PowerShell script which would put all the members of a OM2012 Computer Group in Maintenance Mode, so this could be used with the Task Scheduler.

    I know there are quite some alternative when it comes to putting instances in Maintenance Mode, but I thought it would be cool to create the mother-of-all maintenance mode PowerShell scripts for OM2012 :-)

    This PowerShell script can be run standalone or scheduled with the Task Scheduler and has the following cool features:

    • Acts as a “real” Cmdlet, with features like:
      • Verbose info
      • Debug info
      • WhatIf switch
    • Help info with Examples
    • Write to Eventlog switch for auditing purposes.
    • No need to run it from the Operations Manager Shell. If the OperationsManager Module is not loaded it will be loaded automatically by the script.

     

    Ok enough about the features, here is the script:

    #######################################################################################################################             
    # Puts a OM2012 Computer Group in Maintenance Mode using PowerShell             
    # Author: Stefan Stranger (Microsoft)             
    # Example usage: Run Get-Help Get-SCOMMaintenanceModeForGroups.ps1 -Examples            
    # Disclamer: This program source code is provided "AS IS" without warranty representation or condition of any kind            
    # either express or implied, including but not limited to conditions or other terms of merchantability and/or            
    # fitness for a particular purpose. The user assumes the entire risk as to the accuracy and the use of this            
    # program code.            
    # Tested on PowerShell v3 and OM2012 environment             
    # Date: 03-07-2012             
    # Name: Get-SCOMMaintenanceModeForGroups.ps1             
    # v1.000 - 03-07-2012 - Stefan Stranger - initial sstranger's release            
    # v1.001 - 06-07-2012 - Stefan Stranger - Added Eventlog and WhatIf Switch 
    # v1.003 - 07-11-2012 - Stefan Stranger - Fixed issue on PowerShell v2, Now works on v2 and v3 # v1.004 - 16-11-2012 - Stefan Stranger - Fixed issue with empty GroupMembershipNames issue
    ######################################################################################################################## <# .SYNOPSIS Places all members of a SCOM Computer Group in into maintenance mode, and creates new active maintenance mode entries. .DESCRIPTION The Start-MaintenanceModeForGroups script places all members of a SCOM Computer Group into maintenance mode, and creates new active maintenance mode entries. When in maintenance mode, alerts, notifications, rules, monitors, automatic responses, state changes, and new alerts are suppressed for the class instance. .EXAMPLE Start-SCOMMaintenanceModeForGroup.ps1 -ComputerGroup "All Windows Computers" -EndTime 10 -Reason "UnplannedOther" -Comment "Testing Maintenance Mode" -Verbose Puts all Members of the "All Windows Computer" Group in Maintenance Mode for 10 minutes, with Reason "UnplannedOther" and with Comment "Testing Maintenance Mode". Adding Verbose information. .EXAMPLE Start-SCOMMaintenanceModeForGroup.ps1 -ComputerGroup "All Windows Computers" -EndTime 10 -Reason "UnplannedOther" -Comment "Testing Maintenance Mode" -Eventlog Puts all Members of the "All Windows Computer" Group in Maintenance Mode for 10 minutes, with Reason "UnplannedOther" and with Comment "Testing Maintenance Mode". Writing Eventlog information to the "Operations Manager" Eventlog (eventid 998 and eventid 999). Can be used for tracking and debugging when Task Scheduler is being used. .EXAMPLE Start-SCOMMaintenanceModeForGroup.ps1 -ComputerGroup "All Windows Computers" -EndTime 10 -Reason "UnplannedOther" -Comment "Testing Maintenance Mode" -WhatIf Using the WhatIf switch shows which Members of the "All Windows Computer" Group would be put in Maintenance Mode if you had run the script. So the members are not really put into maintenance mode. For testing purposes. .PARAMETER ComputerGroup The SCOM Computer Group name for which members you want to put in Maintenance Mode. .PARAMETER EndTime Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. .PARAMETER Reason Specifies the reason for placing the resource into maintenance mode. Valid values are: UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity .Parameter Comment Allows you to type a comment about the maintenance activity. .Parameter EventLog Writes information to the "Operations Manager" Eventlog to track what is happening. .Link http://blogs.technet.com/stefan_stranger#> #requires -version 2.0 [CmdletBinding(SupportsShouldProcess=$true)] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='What is the ComputerGroup you want to put in Maintenance Mode?')] [Alias("Group")] [string[]]$ComputerGroup, [Parameter(Mandatory=$True, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$True, HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter')] [int]$EndTime, [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')] [string]$Reason, [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='Allows you to type a comment about the maintenance activity.')] [string]$Comment, [switch]$EventLog ) set-strictmode -version latest $start=Get-Date $currentlog = $start.ToString() Write-Verbose "Starting $($myinvocation.mycommand)" Write-Verbose "Ready to put ComputerGroup $ComputerGroup in Maintenance Mode" Function Start-SCOMMaintenanceModeForGroup { <# .SYNOPSIS Sets a SCOM Group in Maintenance Mode .DESCRIPTION Sets the members of a SCOM Group in Maintenance Mode .EXAMPLE Start-SCOMMaintenanceModeForGroup -ComputerGroup "All Windows Computers" -EndTime 10 -Reason "UnplannedOther" -Comment "Testing Maintenance Mode" -Verbose .PARAMETER ComputerGroup The SCOM Computer Group name for which members you want to put in Maintenance Mode. .PARAMETER EndTime Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. .PARAMETER Reason Specifies the reason for placing the resource into maintenance mode. Valid values are: UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity .Parameter Comment Allows you to type a comment about the maintenance activity. .Link http://blogs.technet.com/stefan_stranger #> [CmdletBinding(SupportsShouldProcess=$true)] param ( [Parameter(Mandatory=$True, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='What is the ComputerGroup you want to put in Maintenance Mode?')] [Alias("Group")] [string[]]$ComputerGroup, [Parameter(Mandatory=$True, ValueFromPipeline=$false, ValueFromPipelineByPropertyName=$True, HelpMessage='Specifies the time the maintenance will end. The minimum amount of time a resource can be in maintenance mode is 5 minutes. This is a required parameter')] [int]$EndTime, [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='UnplannedOther, PlannedHardwareMaintenance, UnplannedHardwareMaintenance, PlannedHardwareInstallation, UnplannedHardwareInstallation, PlannedOperatingSystemReconfiguration, UnplannedOperatingSystemReconfiguration, PlannedApplicationMaintenance, ApplicationInstallation, ApplicationUnresponsive, ApplicationUnstable, SecurityIssue, LossOfNetworkConnectivity')] [string]$Reason, [Parameter(Mandatory=$False, ValueFromPipeline=$True, ValueFromPipelineByPropertyName=$True, HelpMessage='Allows you to type a comment about the maintenance activity.')] [string]$Comment, [switch]$EventLog ) Begin { Write-Verbose "Starting Function Start-SCOMMaintenanceModeForGroup Function" #Check for minumum Maintenance mode period of 5 mins. if($endtime -lt 5) { Write-Error "The time span for the maintenance mode should be at least 5 minutes." -ErrorAction Stop } Write-Verbose "Following Group Members will be put in Maintenance Mode:" $ComputerGroupMembers = Get-SCOMMonitoringObject -DisplayName $ComputerGroup if($ComputerGroupMembers) { #$ComputerGroupMemberNames = ($ComputerGroupMembers.getrelatedMonitoringObjects() | select DisplayName).DisplayName
    $ComputerGroupMemberNames = ($ComputerGroupMembers.getrelatedMonitoringObjects() | select DisplayName)
    Write-Verbose "$ComputerGroupMemberNames" #Retrieve Management Servers so we can check if we don't put Management Servers in MM. $MSs = Get-SCOMManagementServer } else { Write-Error "No Members of ComputerGroup $ComputerGroup found" -ErrorAction Stop } } #End Begin Process { #Put Agents in Maintenance Mode foreach ($agent in $ComputerGroupMembers.getrelatedMonitoringObjects()) { Write-Verbose "Checking if ComputerGroup Member $agent is not a Management Server" if(($MSs | Select DisplayName) -eq $agent) { Write-Verbose "We don't want to put a Management Server in MM. Skipping" } else { Write-Verbose "Let's put Agent $Agent in Maintenance Mode" $Instance = Get-SCOMClassInstance -Name $Agent if ($PSCmdlet.ShouldProcess("Putting $Agent in Maintenande Mode for $($Endtime) minutes") ) { #Added 5 seconds to EndTime to prevent failing the Start-SCOMMaintenanceMode cmdlet. Min. 5 mins is needed. Start-SCOMMaintenanceMode -Instance $Instance -EndTime ([System.DateTime]::Now).AddSeconds(5).addMinutes($EndTime) -Reason $Reason -Comment $Comment }#End of whatif }#End of else }#End Foreach if ($PSBoundParameters['EventLog']) { write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 999 -message "The following Objects are put into in Maintenance Mode for $($EndTime) minutes: $($ComputerGroupMembers.getrelatedMonitoringObjects())" }#End if } #End Process End { Write-Verbose "Finished Function Start-SCOMMaintenanceModeForGroup Function" } } #Main try { if ($PSBoundParameters['EventLog']) { write-eventlog -LogName "Operations Manager" -Source "OpsMgr SDK Service" -EventID 998 -message "The $($myinvocation.mycommand) is used to put Objects in Maintenance Mode" } Write-Verbose "Checking if OperationsManager Module is loaded" #Check if OperationsManager Module is loaded. if(!(Get-Module OperationsManager)) { Write-Verbose "Importing OperationsManager Module" Import-Module OperationsManager -ErrorAction Stop } Write-Verbose "Checking for OM2012 environment" #Check if OM2012 is being used. if(!(Get-Module OperationsManager).Description -eq "Operations Manager OperationsManagerV10 Module") { Write-Error "This script is only for OM2012" } #Call Function if ($PSBoundParameters['EventLog']) { Start-SCOMMaintenanceModeForGroup -ComputerGroup $ComputerGroup -EndTime $EndTime -Reason $Reason -Comment $Comment -EventLog } else { Start-SCOMMaintenanceModeForGroup -ComputerGroup $ComputerGroup -EndTime $EndTime -Reason $Reason -Comment $Comment } } #End Try catch [System.IO.FileNotFoundException] { "OperationsManager Module not found" $_.Exception.Message } catch { Write-Warning "Oops something went wrong" $_.Exception.Message } $end=Get-Date Write-Debug ("Total processing time {0}" -f ($end-$start).ToString()) Write-Verbose "Ending $($myinvocation.mycommand)"

     

    You can use the Get-Help Get-SCOMMaintenanceModeForGroups.ps1 –full command in PowerShell to see the complete help for this script.

    image

    Example using the –WhatIf switch

    image

    Let’s do the real deal and put some members of my “Stefan – OM2012 Maintenance Computer Group” in Maintenance Mode for 5 minutes.

    image

    Result:

    image

    image

     

    How do use this cool PowerShell script to schedule Maintenance Mode using the Task Scheduler?

    Steps:

      1. Save script as: D:\Scripts\OM2012\Start-SCOMMaintenanceModeForGroups.ps1

      2. Open TaskScheduler (on OM2012 Management Server or where you have installed the Operations Manager Console)
        image

      3.  

        Create a new Task
        image

         

      4. Enter Name and make sure the user account under which the Scheduled Task is running is having enough permissions in SCOM. Select Run with Highest privileges.
        image

      5. Configure Trigger
        image

      6. Add action

        Program/script: powershell.exe

        Add argument (optional): D:\Scripts\OM2012\Start-SCOMMaintenanceModeForGroups.ps1 -ComputerGroup 'Stefan - OM2012 Maintenance Computer Group' -EndTime 5 -Reason "UnplannedOther" –Comment 'Testing MM' -Eventlog

        Remark: Make sure you use single quotes of ComputerGroup, Reason or Comment Parameters if space are being used in the name.

        image

      7. Enter Credentials

        clip_image001

        clip_image002

        clip_image003

    If you have scheduled to script using the EventLog Switch toy can look in the Operations Manager Eventlog for auditing info.
    image

    You can download the script from the Script Center Repository: http://gallery.technet.microsoft.com/scriptcenter/Put-OM2012-Computer-Group-43902672

    Have fun!

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Everything you wanted to know about OpsMgr Data Warehouse Grooming but were afraid to ask

    • 0 Comments

    I know there are already quite some other blog posts about OpsMgr Data Warehouse Grooming.  But I was helping a customer with grooming their OpsMgr Data Warehouse Database (OperationsManagerdw) and got some questions. And you may have the same questions but you are afraid to ask ;-)

    1. How can I change the Grooming settings for the OpsMgr Data Warehouse?
      This cannot be done from within the OpsMgr Console.
      So what are the options then?
      1. DWdatarp tool

        Use the Data Warehouse Data Retention Policy (dwdatarp.exe) tool from the MOM team weblog.

        Tip: if after running the tool you don’t see any results, you may not be dbowner on the OperationsManagerDW database.

        image 

        You can save the results to a csv, but you need to do some manual stuff in Excel to have a nice formatted overview.
         image

        Read the help (dwdatarp /?) for all the options. You can also change the Grooming settings for the OpsMgr Data Warehouse with this tool.
      2. SQL queries
        You have to use some SQL queries and run those on the operationsmanagerdw database in SQL Server Management Studio.
        image 

        To view the Current OpsMgr Data Warehouse queries I use the next SQL queries from several sources.

        --Current Grooming Settings
        USE OperationsManagerDW
        SELECT AggregationIntervalDurationMinutes, BuildAggregationStoredProcedureName, GroomStoredProcedureName, MaxDataAgeDays, GroomingIntervalMinutes, MaxRowsToGroom FROM StandardDatasetAggregation

        --Last Grooming Time
        USE OperationsManagerDW
        select
        min(datetime) as MinDate,
        max(datetime) as MaxDate,
        datediff(d,min(datetime),max(datetime)) AS NoOfDaysInDataSet
        from Perf.vPerfHourly

        --To view the number of days of total data of each type in the DW:
        USE OperationsManagerDW
        SELECT DATEDIFF(d, MIN(DWCreatedDateTime), GETDATE()) AS [Current Alert] FROM Alert.vAlert
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current Event] FROM Event.vEvent
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current Perf Raw] FROM Perf.vPerfRaw
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current Perf Hourly] FROM Perf.vPerfHourly
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current Perf Daily] FROM Perf.vPerfDaily
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current State Raw] FROM State.vStateRaw
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current State Hourly] FROM State.vStateHourly
        SELECT DATEDIFF(d, MIN(DateTime), GETDATE()) AS [Current State Daily] FROM State.vStateDaily

        --To view the oldest and newest recorded timestamps of each data type in the DW:
        USE OperationsManagerDW
        select min(DateTime) AS [Oldest Event Date] from Event.vEvent
        select max(DateTime) AS [Newest Event Date] from Event.vEvent
        select min(DateTime) AS [Oldest Perf Date]from Perf.vPerfRaw
        select max(DateTime) AS [Newest Perf Date]from Perf.vPerfRaw
        select min(DWCreatedDateTime) AS [Oldest Alert Date] from Alert.vAlert
        select max(DWCreatedDateTime) AS [Newest Alert Date] from Alert.vAlert

        --Which Tables used the most space
        USE OperationsManagerDW
        SELECT so.name,
        8 * Sum(CASE WHEN si.indid IN (0, 1) THEN si.reserved END) AS data_kb,
        Coalesce(8 * Sum(CASE WHEN si.indid NOT IN (0, 1, 255) THEN si.reserved END), 0) AS index_kb,
        Coalesce(8 * Sum(CASE WHEN si.indid IN (255) THEN si.reserved END), 0) AS blob_kb
        FROM dbo.sysobjects AS so JOIN dbo.sysindexes AS si ON (si.id = so.id)
        WHERE 'U' = so.type GROUP BY so.name  ORDER BY data_kb DESC


        If you look at results of the first two queries (current grooming settings and last grooming time)
         image
        Another interesting query is the “Which Tables used the most space” query. You can run this query before and after changing the grooming settings to see if the grooming had any effect.
        If you want to change the Grooming settings you can use the next queries.
        N.B. Change to the values you want to have your Grooming settings configured!!

        -- From http://ops-mgr.spaces.live.com/blog/cns!3D3B8489FCAA9B51!176.entry
        -- Alert Data:

        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 100
        WHERE GroomStoredProcedureName = 'AlertGroom'

        --Event Data:
        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 40
        WHERE GroomStoredProcedureName = 'EventGroom'

        --Performance Data:
        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 100
        WHERE GroomStoredProcedureName = 'PerformanceGroom' AND AggregationIntervalDurationMinutes = '60'

        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 200
        WHERE GroomStoredProcedureName = 'PerformanceGroom' AND AggregationIntervalDurationMinutes = '1440'

        --State Data:
        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 40
        WHERE GroomStoredProcedureName = 'StateGroom' AND MaxDataAgeDays = 180

        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 100
        WHERE GroomStoredProcedureName = 'StateGroom' AND AggregationIntervalDurationMinutes = '60'

        USE OperationsManagerDW
        UPDATE StandardDatasetAggregation
        SET MaxDataAgeDays = 200
        WHERE GroomStoredProcedureName = 'StateGroom' AND AggregationIntervalDurationMinutes = '1440'

    2. How can I see if Grooming has worked?
      You can check if Grooming has worked after changing the Grooming settings by looking at the dwdatarp tool results or by running some SQL queries.

      Tip: save the results from the dwdatarp tool or SQL queries before and after changing the grooming settings to compare them.

      If you have used the dwdatarp tool for saving the before and after grooming results you can have a look at the columns Current Size and Current Row Count if they changed after changing the grooming settings. 
      image   

      If you like to use SQL you can run the “Which Tables used the most space” sql query to look if those have changed after changing the grooming settings.

      It’s also important to look at the current size and free space of the operationsmanagerdw before starting to groom.

      image
    3. Why don’t my database files shrink after grooming?
      That’s another question people often ask, and that is because the SQL DB files are static – they are manually sized. You can check your autogrow settings for the OperationsManagerDW with the Microsoft SQL Server Management Studio. For the OperationsManager Database Autogrow is default disabled and for the OperationsManagerDW the default setting for Autogrow is enabled.
      image
      If you look at the Autoshrink setting for the OperationsManagerDW you can see it’s disabled.
      image
      That’s why the database files won’t shrink after grooming has taken place. Please keep in mind that we don’t support/recommend EVER shrinking a DB file for OpsMgr. It causes fragmentation issues.

      The only thing that will change (shrink) after grooming is the used space in the database. You can check the used space for a database with the Disk Usage Report in Microsoft SQL Server Management Studio.
      image

      image

      But, sometimes shrinking the database is the only option left if you don’t have any space left…

    Disclaimer

    Please be very careful when changing your grooming settings, you can loose data ;-) Posts in this blog are provided "AS IS" with no warranties, and confers no rights. Use of included script samples are subject to the terms specified in the Terms of Use

    Links to other blog posts about Grooming:

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    What Monitors, Rules and Discoveries are running on an OpsMgr Agent?

    • 16 Comments

    How often do you get the question: “What Monitors, Rules and Discoveries are running on an OpsMgr Agent?” from your co-workers? Especially when they don’t have a clue what is being monitored for their servers.

    Most of the time you just use the EffectiveConfigurationViewer from the OpsMgr Resource Kit. It let’s you pick different objects, besides the Agents you are monitoring with OpsMgr.

    image

    image

    It’s shows quite some interesting information and let’s you export the result to an XML file. But that’s not always your co-workers want’s to see. IMO they often want to have an Excel sheet with all the Monitors and Rules running on a specific Agent. That’s what they understand and can easily read.

    What options do you have now?

    1. You can try to build some wrapper around the exported XML file, with PowerShell.
      image
    2. Use a third-party tool, like MP Studio to export the Monitors, Rules and Discoveries (workflows) running on an Agents
    3. Create a PowerShell script that does the magic Winking smile

    Let’s look at the options.

     

    Build some wrapper around the exported XML file

    This is possible, but would not give us all the information we would like to see. It can only give us the Monitor/Rule or Discovery Name and it’s state. We are interested in much more, like: Name, Description, Type, Management Pack, Overrides, etc.

    So let’s skip this option.

     

    Use a third-party tool

    In the next version of MP Studio a new feature called Silect’s Agent Explorer will be added. I’m lucky to be able to test the latest evaluation version of MP Studio and it will be able to give you almost all the information you probably need.

    If you want to see what Monitors, Rules and Discoveries are running on an Agent, you can use the Explore workflow tasks feature (Agent Explorer) to view all workflows running on all agents or a specific server.

    image

     

    It will give you an overview of all Workflows running on a specified Agent and you can export the result to Excel.

    image

    This is almost what I want to see. The only thing I’m missing in the current Agent Explorer feature is if there are overrides configured for a Monitor, Rule or Discovery. I talked with Randy Roffey from Silect about this, and he told me that would be challenge, because there can be be multiple override settings for the same workflow. Good point, but it would be nice to see if there are any overrides for a workflow, than you can always manually check the configured overrides later.

     

    PowerShell script that does the magic

    The last option we have is to create a PowerShell script that does all we want. And what do we want? We want an Excel sheet with all Monitors, Rules and Discoveries running on an Agent, with their Type, DisplayName, Description, possible Override and ManagementPack.

    image

    image

    Here you can see again 768 workflows running on the OpsMgr Agent (just like in MP Studio) but it also shows if there is an Override* being configured for the Monitor, Rule or Discovery. This still does not mean that the override is applicable for the Agent though.

    * Retrieving the Override information can be a time (CPU and Memory) consuming exercise, so I commented that part of the PowerShell script.

     

    Drawback I found using this script is the impact on the CPU and Memory when running this script and the time it takes before this script finishes. So you may take that into consideration when you run this script. First it retrieves all the Monitors, Rules and Discoveries and saves that in Memory and loops through this data in memory for finding the workflow information.

    When I tested this script in my small OpsMgr 2007 R2 environment it took 1:47 seconds to run.

    image

    But it can also take much longer Sad smile, like 27 minutes in another larger OpsMgr 2007 R2 environment.

    image

     

    If you are still interested to give the script a try, here it is:

    ###############################################################################                        
    # Get OpsMgr 2007 Running Workflows using PowerShell                        
    # This script retrieves the workflows running on an OpsMgr Agent                        
    # Authors: Jeremy Pavleck & Stefan Stranger (Microsoft)            
    # Example usage (run from OpsMgr Command Shell): Get-OpsMgrWorkflows_v1.ps1 -agentname "myagent.contoso.com" | export-csv -path c:\temp\workflows.csv            
    # Date:		30-11-2010                        
    # Name: 	Get-AgentWorkflows_v1.ps1            
    # Remarks: 	Warning: Script is CPU and Memory intensive!!            
    #		Retrieving the overrides for the Monitors, Rules and Discoveries turned out to be a time, CPU and Memory consuming exercise and I disabled it.            
    #          	You can enable it by Uncommenting that part of the script if you want to.            
    #		Script needs to run in PowerShell version 2.            
    # v1.000 - 	30/11/2010 - stefstr - initial sstranger's release                        
    ###############################################################################            
                
    param ([string]$agentname = $(read-host "Please enter OpsMgr Agent Name"))             
                
    function Get-AgentWorkflow($agentname)            
    {            
     #Original Script from Jeremy Pavleck.            
     #http://www.pavleck.net/2008/06/sp1-gem-finding-rules-running-on-remote-agents/            
     #Use the OpsMgr Task Show Running Rules and Monitors.            
     $taskobj = Get-Task | Where-Object {$_.Name -eq "Microsoft.SystemCenter.GetAllRunningWorkflows"}            
                 
     # Grab HealthService class object            
     $hsobj = Get-MonitoringClass -name "Microsoft.SystemCenter.HealthService"            
     # Find HealthService object defined for named server            
     $monobj = Get-MonitoringObject -MonitoringClass $hsobj | Where-Object {$_.DisplayName -match $agentname}            
                 
     #Start Task GetAllRunningWorkflows            
     $taskOut = Start-Task -Task $taskobj -TargetMonitoringObject $monobj            
     [xml]$taskXML = $taskOut.OutPut             
                 
     #Get Workflows            
     $workflows=$taskXML.selectnodes("/DataItem/Details/Instance/Workflow")            
                 
     #Retrieve Monitors            
     $monitors = get-monitor            
                 
     #Retrieve Rules            
     $rules = get-rule            
                 
     #Retrieve Discoveries"            
     #Used the Group-object because there are some discovery rules with the same DisplayName            
     $discoveries = get-discovery | select-object -Unique            
                 
     #Get Overrides"            
     #monitoroverrides = foreach ($monitor in Get-ManagementPack | get-override | where {$_.monitor}) {get-monitor | where {$_.Id -eq $monitor.monitor.id}}            
     #$rulesoverrides = foreach ($rule in Get-ManagementPack | get-override | where {$_.rule}) {get-rule | where {$_.Id -eq $rule.rule.id}}            
     #$discoveryoverrides = foreach ($discovery in Get-ManagementPack | get-override | where {$_.discovery}) {get-discovery | where {$_.Id -eq $discovery.discovery.id}}            
                
                
     #Check for each workflow if it's a Rule or Monitor or Discovery.            
     foreach ($workflow in $workflows)            
     {            
      #Check for Monitor            
      $monitor = $monitors | where-object {$_.Name -eq $workflow."#text"}            
                  
      if ($monitor -eq $null)            
      {            
       #Check for Rule            
       $rule = $rules | where-object {$_.Name -eq $workflow."#text"}            
       if ($rule -eq $null)            
       {             
        #Check for Discovery            
        $discovery = $discoveries | where-object {$_.Name -eq $workflow."#text"}            
        if ($discovery -eq $null)            
        {            
                    
        }            
        else            
        {            
         #Get ManagementPack            
         $mp = $discovery.getmanagementpack()            
         #Check if Discovery has an override            
         #$flag = $discoveryoverrides | Where-Object {$_.DisplayName -eq $discovery.DisplayName}            
         #if ($flag -eq $null)            
         #{            
         #	$override = "false"            
         #}            
         #else            
         #{            
         #	$override = "true"            
         #}            
         $discobject = new-object System.Management.Automation.PSObject            
         $discobject = $discobject | add-member -membertype NoteProperty -name Type -value "Discovery" -passthru            
         $discobject = $discobject | add-member -membertype NoteProperty -name DisplayName -value $discovery.DisplayName -passthru            
         $discobject = $discobject | add-member -membertype NoteProperty -name Description -value $discovery.Description -passthru            
         #$discobject = $discobject | add-member -membertype NoteProperty -name Override -value $override -passthru            
         $discobject = $discobject | add-member -membertype NoteProperty -name ManagementPack -value $mp.DisplayName -passthru            
         $discobject            
        }            
       }            
       else            
       {            
        $mp = $rule.getmanagementpack()            
        #Check if Rule has an override            
        #$flag = $ruleoverrides | Where-Object {$_.DisplayName -eq $rule.DisplayName}            
        #if ($flag -eq $null)            
        #{            
        #	$override = "false"            
        #}            
        #else            
        #{            
        #	$override = "true"            
        #}            
        $ruleobject = new-object System.Management.Automation.PSObject            
        $ruleobject = $ruleobject | add-member -membertype NoteProperty -name Type -value "Rule" -passthru            
        $ruleobject = $ruleobject | add-member -membertype NoteProperty -name DisplayName -value $rule.DisplayName -passthru            
        $ruleobject = $ruleobject | add-member -membertype NoteProperty -name Description -value $rule.Description -passthru            
        #$ruleobject = $ruleobject | add-member -membertype NoteProperty -name Override -value $override -passthru            
        $ruleobject = $ruleobject | add-member -membertype NoteProperty -name ManagementPack -value $mp.DisplayName -passthru            
        $ruleobject            
       }            
      }            
      else            
      {            
       #Get ManagementPack for Monitor            
       $mp = $monitor.getmanagementpack()            
       #Check if Monitor has an override            
       #$flag = $monitoroverrides | Where-Object {$_.DisplayName -eq $monitor.DisplayName}            
       #if ($flag -eq $null)            
       #{            
       #	$override = "false"            
       #}            
       #else            
       #{            
       #	$override = "true"            
       #}            
       $monitorobject = new-object System.Management.Automation.PSObject            
       $monitorobject = $monitorobject | add-member -membertype NoteProperty -name Type -value "Monitor" -passthru            
       $monitorobject = $monitorobject | add-member -membertype NoteProperty -name DisplayName -value $monitor.DisplayName -passthru            
       $monitorobject = $monitorobject | add-member -membertype NoteProperty -name Description -value $monitor.Description -passthru            
       #$monitorobject = $monitorobject | add-member -membertype NoteProperty -name Override -value $override -passthru            
       $monitorobject = $monitorobject | add-member -membertype NoteProperty -name ManagementPack -value $mp.DisplayName -passthru            
       $monitorobject            
      }            
     }            
                
                
    }            
                
    Get-AgentWorkflow $agentname

    Disclaimer

    This sample is not supported under any Microsoft standard support program or service. This sample is provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of this sample and documentation

    remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of this sample be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use this sample or documentation, even if Microsoft has been advised of the possibility of such damages.

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Compare two different csv files using PowerShell

    • 0 Comments

    Today I needed to compare two csv files with results from SQL queries from the OperationsManager database and the OperationsManagerDW database. I run the SQL queries on both OperationsManager databases and saved the result to a csv file. Now I needed to quickly compare the results from both csv files, and what better way than to use PowerShell.

    Here is an example how you can use PowerShell to quickly compare two csv files:

    First some example CSV files:

    Example CSVFile1.csv

    ManagementPackId,MPFriendlyName,MPName,mp.MPVersionDependentId,MPLastModified,MPKeyToken,ContentReadable
    3A7609F3-A5AB-F205-5001-010EE387DD28,Customer - Exchange 2007 MP overrides,Customer.Exchange.MP.overrides,5D49AADA-DFEE-40DC-9A32-2758FC71B426,2011-01-06 16:39:57.517,NULL,1
    49C911AC-337C-CD94-DD13-021E2CFDDAB0,Customer - SCOM MS,Customer.SCOM.MS,9FA54A57-B123-44AE-A9AB-ED1A1C4CDB35,2011-01-27 09:16:28.100,NULL,1
    C0A4183F-4318-CB0C-EF5A-054B32AE33B4,Windows Server 2000 Operating System Overrides,Windows.Server.2000.Operating.System.Overrides,6293AED6-DE8F-462E-AD54-1F83F2E33F82,2011-02-04 14:38:19.330,NULL,1
    3DFAC27F-8551-B71B-7DD2-30156A31CD92,Customer - Citrix Beheer - WIS Servers Events,Customer.Citrix.Beheer.WIS.Servers.Events,4496E575-C63C-4B45-BEF7-6216668264F7,2010-12-06 01:54:15.963,NULL,1
    3AFE86A8-827C-CDB6-9A84-32C67483C3D1,Windows cluster management monitoring - overrides,Windows.cluster.management.monitoring.overrides,243D4B09-9455-4737-9880-399CF2700CF4,2011-02-04 16:07:11.377,NULL,1
    6569E210-F188-EEF7-05CA-331859F4D8C6,Customer - Citrix Beheer,Customer.Citrix.Beheer,8109BB67-C923-4814-A1DB-F2A386B2389B,2011-01-17 13:58:08.690,NULL,1
    8BDC857A-7F32-40A7-E5C2-4583E263B290,Customer - ISA server 2006,Customer.ISA.server,68F24CBA-B6C7-474B-A09B-03B0D730609B,2011-01-07 10:56:51.290,NULL,1
    C39E8EF5-5E04-9CAE-F467-61D87ACD5E9E,Customer - Windows Server - SCCM,Customer.Windows.Server.SCCM,7BB1925D-007A-4621-BAD3-56F87B49C4C8,2011-01-17 13:02:28.880,NULL,1
    A2B5CA86-96F7-F4CA-2152-63274CEF3336,Customer - Sharepoint Server,Customer.Sharepoint.Server,26E07753-0740-450F-972C-6A16C2099C12,2011-01-06 07:26:36.533,NULL,1
    5BC992B2-96F6-E192-6E92-65FB5EC0CE5E,Customer - SQL Server (Monitoring),Customer.SQL.Server.Monitoring,2618C5C0-D89F-4E86-8259-FD7809D75E7C,2011-02-07 14:12:14.613,NULL,1
    E4056BA9-CFC7-2D04-FF9B-67084CC15E83,Customer - Print Servers,Customer.Print.Servers,C336C3FD-CF15-4319-A33E-00F4BF2A390D,2010-11-24 10:14:22.660,NULL,1
    3EECB872-CC4A-62BC-EA39-855EF594852D,Customer - Print Beheer Menu MP,Customer.Print.Beheer.Menu.MP,6F12D09D-0A55-40BA-A320-B571E9554ADE,2010-12-21 12:49:53.603,NULL,1
    A2D688EC-8AE1-C4AF-A485-8564C214D292,Customer - Arcserve MP,Customer.Arcserve.MP,7AECFE66-51F6-4174-B84C-E918140F37F2,2010-12-03 11:51:39.080,NULL,1
    A3542697-E0E7-E382-D40B-86ADEC512D79,Windows Server 2008 Operating System (Monitoring) Overrides,Windows.Server.2008.Operating.System.Monitoring.Overrides,20BCC6DC-F928-4108-B70F-873639A0448A,2010-12-16 12:16:40.800,NULL,1
    070A0205-56D6-FF84-688A-8A216A47A949,Customer - Fileservers Dienst,Customer.Fileservers.Dienst,7DDF2381-3B13-4971-9E91-6656075C2E60,2010-12-22 09:26:50.683,NULL,1
    98701ABB-AF93-7E5A-D121-9A18E0037CE8,Customer - DSA & PKI Gateways,Customer.DSA.PKI.Gateways,95B49F67-9514-4E80-991D-B3CF4EA2632F,2010-12-20 11:38:44.697,NULL,1
    FA4FDEAF-E107-8AA3-BD2C-9E29C58C0C53,Customer - PKI Management,Customer.PKI.Management,6B677888-07F1-4725-BA3F-E742B20FA9C4,2011-01-27 08:45:23.153,NULL,1
    51DA566A-1AC1-5DC9-3F66-A11FC439357C,nworks VMware Virtual Enterprise Monitoring MP,nworks.VMware.VEM,599A587E-3357-A127-50EF-198F04365ADA,2010-11-23 11:10:29.243,65c40f14a98ce59b,1
    512DB9E6-D21A-2E4F-E987-A28BDE8F940B,Customer - Exchange availability,Customer.Exchange.availability,1D0DDA6B-9ED2-48C0-BFEE-1538DA9AE16F,2010-12-27 10:10:30.707,NULL,1
    DD81FA7E-73BF-332B-C4B6-A767BB514BE8,Customer - Connect Direct,Customer.Connect.Direct,9C6BB3FD-6582-4F18-B18C-7BBE4DB9FCA6,2011-01-31 13:47:15.613,NULL,1
    155A8BBB-C6D2-C706-DD1C-B7EFCCCC0E81,Customer - AD Beheer,Customer.AD.Beheer,CF036BAA-47C0-4D09-A2F4-25B3DC1F78B9,2011-01-05 13:17:15.520,NULL,1
    E2296ED5-DDBC-EBC7-3881-C5288ADAA7CF,Microsoft Exchange Server 2010 Management Pack,Microsoft.Exchange.2010,AB06EB14-EAF1-0F0B-04B8-F1CDD33F4ACC,2011-02-04 09:02:29.607,31bf3856ad364e35,1
    9E138797-AE1C-AF6E-E61B-D110253B417C,Engyro Connector TEC,Engyro.Connector.TEC.MP,76306617-5F13-42EB-9F3B-B948F18DC4D8,2010-11-23 11:29:55.980,NULL,1
    A3C3E706-795F-BF80-DFC2-DBB4BDDFA919,Customer - ACS Management Pack,Customer.ACS.Management.Pack,D7C4F7A2-B18D-454F-8615-22CEC4EFDFCA,2011-01-04 12:30:01.593,NULL,1
    7C2A6181-B7B9-89C2-6FC3-EDB760FCEFC1,Microsoft Exchange Server 2007 CAS Monitoring - Override,Microsoft.Exchange.Server.CAS.Monitoring.Override,BA79A086-E992-4AB7-B4B6-933FB8AD1211,2011-01-07 12:39:36.870,NULL,1

     

    Example CSVFile2.csv

    ManagementPackId,MPFriendlyName,MPName,mp.MPVersionDependentId,MPLastModified,MPKeyToken,ContentReadable
    3A7609F3-A5AB-F205-5001-010EE387DD28,Customer - Exchange 2007 MP overrides,Customer.Exchange.MP.overrides,5D49AADA-DFEE-40DC-9A32-2758FC71B426,2011-01-06 16:39:57.517,NULL,1
    49C911AC-337C-CD94-DD13-021E2CFDDAB0,Customer - SCOM ,Customer.SCOM,9FA54A57-B123-44AE-A9AB-ED1A1C4CDB35,2011-01-27 09:16:28.100,NULL,1
    C0A4183F-4318-CB0C-EF5A-054B32AE33B4,Windows Server 2000 Operating System Overrides,Windows.Server.2000.Operating.System.Overrides,6293AED6-DE8F-462E-AD54-1F83F2E33F82,2011-02-04 14:38:19.330,NULL,1
    F37D0C95-F313-4EC9-5385-0F41BFCFE55D,Customer Custom Monitoring,Customer.Custom.Monitoring,44597F97-6FD4-4D2E-B01E-5CDB9B218E50,2011-01-27 08:52:20.377,NULL,1
    75E3375E-B1CD-4641-E86B-2664A7E7E7C2,Customer - Microsoft Exchange 2010 Override MP,Customer.Microsoft.Exchange.Override.MP,6DC9439A-BD4C-46C0-8D2F-080029042A6D,2011-02-04 11:12:40.857,NULL,1
    3DFAC27F-8551-B71B-7DD2-30156A31CD92,Customer - Citrix Beheer - WIS Servers Events,Customer.Citrix.Beheer.WIS.Servers.Events,4496E575-C63C-4B45-BEF7-6216668264F7,2010-12-06 01:54:15.963,NULL,1
    3AFE86A8-827C-CDB6-9A84-32C67483C3D1,Windows cluster management monitoring - overrides,Windows.cluster.management.monitoring.overrides,243D4B09-9455-4737-9880-399CF2700CF4,2011-02-04 16:07:11.377,NULL,1
    6569E210-F188-EEF7-05CA-331859F4D8C6,Customer - Citrix Beheer,Customer.Citrix.Beheer,8109BB67-C923-4814-A1DB-F2A386B2389B,2011-01-17 13:58:08.690,NULL,1
    B5FE879F-CD35-DD9A-7464-36401ABB9205,Microsoft Exchange 2010 Report Library,Microsoft.Exchange.2010.Reports,112EA102-A45A-9AA9-C84D-1ED9A56E8C61,2011-02-04 10:31:14.137,31bf3856ad364e35,1
    DA187E72-B9D7-9E16-D098-3B0A624DC38C,My Default Management Pack,Microsoft.SystemCenter.OperationsManager.DefaultUser,497CE20F-02AF-417E-97B1-363F311CF739,2011-02-03 16:37:16.093,NULL,1
    8BDC857A-7F32-40A7-E5C2-4583E263B290,Customer - ISA server 2006,Customer.ISA.server,68F24CBA-B6C7-474B-A09B-03B0D730609B,2011-01-07 10:56:51.290,NULL,1
    C39E8EF5-5E04-9CAE-F467-61D87ACD5E9E,Customer - Windows Server - SCCM,Customer.Windows.Server.SCCM,7BB1925D-007A-4621-BAD3-56F87B49C4C8,2011-01-17 13:02:28.880,NULL,1
    A2B5CA86-96F7-F4CA-2152-63274CEF3336,Customer - Sharepoint Server,Customer.Sharepoint.Server,26E07753-0740-450F-972C-6A16C2099C12,2011-01-06 07:26:36.533,NULL,1
    5BC992B2-96F6-E192-6E92-65FB5EC0CE5E,Customer - SQL Server (Monitoring),Customer.SQL.Server.Monitoring,2618C5C0-D89F-4E86-8259-FD7809D75E7C,2011-02-07 14:12:14.613,NULL,1
    E4056BA9-CFC7-2D04-FF9B-67084CC15E83,Customer - Print Servers,Customer.Print.Servers,C336C3FD-CF15-4319-A33E-00F4BF2A390D,2010-11-24 10:14:22.660,NULL,1
    336987CD-60EF-5014-F384-7D37DE784858,Nworks Overrides,Nworks.Overrides,5EF45858-0DC1-4E67-9AFD-F70A2446CCA9,2011-01-25 10:20:27.143,NULL,1
    3EECB872-CC4A-62BC-EA39-855EF594852D,Customer - Print Beheer Menu MP,Customer.Print.Beheer.Menu.MP,6F12D09D-0A55-40BA-A320-B571E9554ADE,2010-12-21 12:49:53.603,NULL,1
    A2D688EC-8AE1-C4AF-A485-8564C214D292,Customer - Arcserve MP,Customer.Arcserve.MP,7AECFE66-51F6-4174-B84C-E918140F37F2,2010-12-03 11:51:39.080,NULL,1
    A3542697-E0E7-E382-D40B-86ADEC512D79,Windows Server 2008 Operating System (Monitoring) Overrides,Windows.Server.2008.Operating.System.Monitoring.Overrides,20BCC6DC-F928-4108-B70F-873639A0448A,2010-12-16 12:16:40.800,NULL,1
    070A0205-56D6-FF84-688A-8A216A47A949,Customer - Fileservers Dienst,Customer.Fileservers.Dienst,7DDF2381-3B13-4971-9E91-6656075C2E60,2010-12-22 09:26:50.683,NULL,1
    98701ABB-AF93-7E5A-D121-9A18E0037CE8,Customer - DSA & PKI Gateways,Customer.DSA.PKI.Gateways,95B49F67-9514-4E80-991D-B3CF4EA2632F,2010-12-20 11:38:44.697,NULL,1
    FA4FDEAF-E107-8AA3-BD2C-9E29C58C0C53,Customer - PKI Management,Customer.PKI.Management,6B677888-07F1-4725-BA3F-E742B20FA9C4,2011-01-27 08:45:23.153,NULL,1
    51DA566A-1AC1-5DC9-3F66-A11FC439357C,nworks VMware Virtual Enterprise Monitoring MP,nworks.VMware.VEM,599A587E-3357-A127-50EF-198F04365ADA,2010-11-23 11:10:29.243,65c40f14a98ce59b,1
    512DB9E6-D21A-2E4F-E987-A28BDE8F940B,Customer - Exchange availability,Customer.Exchange.availability,1D0DDA6B-9ED2-48C0-BFEE-1538DA9AE16F,2010-12-27 10:10:30.707,NULL,1
    DD81FA7E-73BF-332B-C4B6-A767BB514BE8,Customer - Connect Direct,Customer.Connect.Direct,9C6BB3FD-6582-4F18-B18C-7BBE4DB9FCA6,2011-01-31 13:47:15.613,NULL,1
    155A8BBB-C6D2-C706-DD1C-B7EFCCCC0E81,Customer - AD Beheer,Customer.AD.Beheer,CF036BAA-47C0-4D09-A2F4-25B3DC1F78B9,2011-01-05 13:17:15.520,NULL,1
    E2296ED5-DDBC-EBC7-3881-C5288ADAA7CF,Microsoft Exchange Server 2010 Management Pack,Microsoft.Exchange.2010,AB06EB14-EAF1-0F0B-04B8-F1CDD33F4ACC,2011-02-04 09:02:29.607,31bf3856ad364e35,1
    9E138797-AE1C-AF6E-E61B-D110253B417C,Engyro Connector TEC,Engyro.Connector.TEC.MP,76306617-5F13-42EB-9F3B-B948F18DC4D8,2010-11-23 11:29:55.980,NULL,1
    A3C3E706-795F-BF80-DFC2-DBB4BDDFA919,Customer - ACS Management Pack,Customer.ACS.Management.Pack,D7C4F7A2-B18D-454F-8615-22CEC4EFDFCA,2011-01-04 12:30:01.593,NULL,1
    7C2A6181-B7B9-89C2-6FC3-EDB760FCEFC1,Microsoft Exchange Server 2007 CAS Monitoring - Override,Microsoft.Exchange.Server.CAS.Monitoring.Override,BA79A086-E992-4AB7-B4B6-933FB8AD1211,2011-01-07 12:39:36.870,NULL,1
    94DDD8EA-2A12-9E54-9545-F4A926DBACF0,System Center Core Monitoring Overrides,System.Center.Core.Monitoring.Overrides,BA527C6E-0E2C-440C-9358-6D073BBD4722,2010-12-07 07:25:25.517,NULL,1

     

    Now we can compare both files with the use of the compare-object cmdlet in PowerShell.

    $file1 = import-csv -Path "C:\temp\Test1.csv"
    $file2 = import-csv -Path "C:\temp\Test2.csv"
    Compare-Object $file1 $file2 -property MPFriendlyName -IncludeEqual

     

    image

    Have fun with PowerShell and the compare-object cmdlet.

     

    (stefan.stranger).gettype()

    IsPublic IsSerial Name BaseType

    -------- -------- ---- --------

    True False Object[] Crappy.Planner

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    OpsMgr 2007 toolbox

    • 10 Comments

    There are so many tools currently developed that it is hard to know where to find them. Here is a list that I know of maybe it’s helpful to you.

    Please let me know if I’m missing one.

    Tool Purpose Description Author Website
    Mpviewer 1.7 MP viewing Browse for both MP and XML files.Export to Excel and HTML. Boris Yanuspolsky OpsMgr++
    ModuleExplorer v2 MP Module Viewing Provide some visibility into the library of modules and information about each module Boris Yanuspolsky OpsMgr++
    OverrideCreator MP editing utility that allows you to multiselect a number of rules/monitors/discoveries and create an override to either disable them or enable them Boris Yanuspolsky OpsMgr++
    Run As profile configuration helper v1 MP Authoring Will allow you to configure a RunAs profile for agents in bulk Boris Yanuspolsky OpsMgr++
    Override Explorer v3.3 MP Viewing View what overrides exist in a management group Boris Yanuspolsky OpsMgr++
    InstallTool MP Authoring Remove override references from the MP you are trying to remove R. Brennan Secure Vantage Team Blog
    Eventlog Explorer Testing and debugging Helps in exploring NT Eventlog sources installed on a local machine and design and fire user selected sets of events involving multiple sources with one button click Zbigniew Butor Operations Manager Product Team Blog
    MP2XMLDumper MP Viewing Export of specific management packs by partial name criteria Clive Eastwood OpsMgr, SCE and MOM Blog
    MgInfo Shows
    MgInfo
    Displays licensing, and some summary information about your management group Clive Eastwood OpsMgr, SCE and MOM Blog
    ProxyCFG Configure/View Configure/view agent proxy (Cmd) Clive Eastwood OpsMgr, SCE and MOM Blog
    ProxySettings v1.1 View Proxy Settings Configure/view agent proxy (GUI) Operations Manager Product Team Contoso.se
    AgentMM Maintenance Mode Puts OpsMgr agents into maintenance mode Clive Eastwood OpsMgr, SCE and MOM Blog
    Windows PowerShell Scriptomatic MP Authoring  Utility that writes WMI scripts for system administration  Ed Wilson  Microsoft Download Center 
    My Log File Viewer Utility  Testing and debugging  Lets you view System Center Operations Manager 2007 Server/Agent Event logs on a remote computer   Jeevan Bisht  Manageability Team Blog 
    Data Warehouse Data Retention Policy (dwdatarp.exe)  Configure/View Allows you to view and configure the data warehouse data retention policies configured within your Operations Manager DW  Daniel Savage  Operations Manager Product Team Blog 
    System Center Content Search Gadget   Knowlegde This gadget makes it easier to find help for Microsoft System Center products because it uses Live Search macros to search specific sites instead of the entire web  Chris Scoville  Live Gallery 
    OpsMgr Linear Explorer Build 316 View  This tool allows you to explore the lineage of OpsMgr MP elements. Vin DiPippo SCOMNIVORE
    OpsMgr Cleanup tool View  Command-line utility that enables you to remove all the components of Operations Manager 2007 from a local computer in cases where the typical method of removing applications through Add or Remove Programs in Control Panel fails Walter Chomak Walter Chomak's System Center Operations Manager 2007 Landing Zone
    SCOM Remote Maintenance Mode Scheduler Management GUI based tool that lets administrators easily schedule maintenance mode for a server or group of servers inside System Center Operations Manager 2007. Tim McFadden Everything System Center Operations Manager 2007
    OpsMgr Alert Closer Management Command line tool that connects to the SDK service on the RMS, retrieves all open alerts, then resolves them. Jeremy D. Pavleck Pavleck.Net
    Log Smith for Operations Manager Management Log Smith connects to your Root Management Server (SDK Service) to gather and display events in a much more flexible way than the original Operations Console. Stefan Koell Code4Ward
    OpsMgr 2007 - RuntimeHealthExplorer Management Tool helps someone with investigation of health state issues Marius Sutara Notes on System Center Operations Manager
  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    OpsMgr 2007 Event 21402

    • 1 Comments
    A colleague of mine Dirk van Coeverden has written an excellent article about troubleshooting OpsMgr 2007 Event 21402. With this article you can see how you can use the Workflow name from the Event details to trace which rule/discovery/monitor is causing the error.

    Introduction

    This article describes how to troubleshoot OpsMgr 2007 Event 21402, which indicates a script error or warning. However the article is intended to be an example for other events, since a lot of details are also in other events (like Workflow name).

            Event Type: Warning
            Event Source: Health Service Modules
            Event ID: 21402
            Description:
                    Forced to terminate the following process started 
                    at 12:08:50 PM because it ran past the configured 
                    timeout 120 seconds.
     

    With this article you will find

    • The discovery, monitor or rule which causes the event
    • Retrieve the script content in a SQL table (limited by SQL2005 Studio)
    • How it looks in XML and understand the workflow

    The query to find the discovery, monitor or rule should work for every event where the workflow name is listed. The script content is more specific to 21402 but might give an impression on how to retrieve content from an XML columns (of NVARCHAR type).

    The queries aren't tested for performance, so the best course is to import the MP of the customer in your test environment and run them on your own machine.

     

    21402 details

    An example of 21402 is

            Event Type: Warning
            Event Source: Health Service Modules
            Event Category: None
            Event ID: 21402
            Date: 7-4-2008
            Time: 4:05:34
            User: N/A
            Computer: server01
            Description:
            Forced to terminate the following process started at 
            04:05:04 because it ran past the configured timeout 30 
            seconds.
    
    
            Command executed: "C:\WINDOWS\system32
            \cscript.exe" /nologo "C:\Program Files\System Center 
            Operations Manager 2007\Health Service State\Monitoring Host 
            Temporary Files 297\177
            \CheckVirtualMachineNameMatchComputerName.vbs"
    
    
            Working Directory: C:\Program Files\System Center Operations 
            Manager 2007\Health Service State\Monitoring Host Temporary 
            Files 297\177\ 
    
    
            One or more workflows were affected by this.  
    
    
            Workflow name: Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineName_does_not_match_computer_name.rule 
            Instance name: servern01.contoso.com 
            Instance ID: {3B3FA6E2-BB6B-CD49-274A-8722250C3D0C} 
            Management group: OpsMgrdemo
    
    
            For more information, see Help and Support Center at 
            http://go.microsoft.com/fwlink/events.asp.

    Important Event Elements

    Command Executed:

    "C:\WINDOWS\system32cscript.exe" /nologo "C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 297\177\CheckVirtualMachineNameMatchComputerName.vbs"

    Working Directory:

    C:\Program Files\System Center Operations Manager 2007\Health Service State\Monitoring Host Temporary Files 297\177\

    Script:

    CheckVirtualMachineNameMatchComputerName.vbs

    Workflow:

    Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineName_does_not_match_computer_name.rule

    Which discovery monitor or rule?

    To find out which discovery monitor or rule the script belongs to run the following SQL script (based on the example event above) on the OperationsManager database.

     DECLARE @ObjectName NVARCHAR(256)
    
    
     SET @ObjectName = 'Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineName_does_not_match_computer_name.rule'
    
    
     IF EXISTS (SELECT 1 FROM DiscoveryView WITH (NOLOCK) WHERE Name = @ObjectName) 
            SELECT 
                    'Discovery' As 'Object Type',
                    d.DisplayName AS 'Displayname in Console',
                    d.Name AS 'Internal Monitor Name',
                    d.Id AS 'MonitorId',
                    p.Displayname AS 'ManagementPack',
                    p.Version AS 'ManagementPack Version',
                    p.Name AS 'Management Pack Library Name'
            FROM DiscoveryView d WITH (NOLOCK)
            INNER JOIN ManagementPackView p WITH (NOLOCK) ON d.ManagementPackId = p.Id
            WHERE d.Name = @ObjectName
     ELSE IF EXISTS (SELECT 1 FROM MonitorView WITH (NOLOCK) WHERE Name = @ObjectName) 
            SELECT 
                    'Monitor' AS 'Object Type',
                    m.DisplayName AS 'Displayname in Console',
                    m.Name AS 'Internal Monitor Name',
                    m.Id AS 'MonitorId',
                    p.Displayname AS 'ManagementPack',
                    p.Version AS 'ManagementPack Version',
                    p.Name AS 'Management Pack Library Name'
            FROM MonitorView m WITH (NOLOCK) 
            INNER JOIN ManagementPackView p WITH (NOLOCK) ON m.ManagementPackId = p.Id
            WHERE m.Name = @ObjectName
     ELSE IF EXISTS (SELECT 1 FROM RuleView WITH (NOLOCK) WHERE Name = @ObjectName) 
            SELECT 
                    'Rule' AS 'Object Type',
                    r.DisplayName AS 'Displayname in Console',
                    r.Name AS 'Internal Rule Name',
                    r.Id AS 'RuleId',
                    p.Displayname AS 'ManagementPack',
                    p.Version AS 'ManagementPack Version',
                    p.Name AS 'Management Pack Library Name'
            FROM RuleView r WITH (NOLOCK) 
            INNER JOIN ManagementPackView p WITH (NOLOCK) ON r.ManagementPackId = p.Id
            WHERE r.Name = @ObjectName

    This will give the following results

    Object Type Displayname_in_Console Internal Rule Name RuleId ManagementPack ManagementPack Version Management Pack Library Name
    Rule Virtual Machine: Virtual machine name does not match computer name Microsoft.Virtualization.VirtualServer.2005R2. VirtualMachineName.rule E465679D-BC55-C4D3-FEF0-C108DF37DFD9 Microsoft Virtual Server 2005 R2 1.0.2627.0 Microsoft.Virtualization.VirtualServer.2005R2

    In the OpsMgr Console / Authoring you can find the Discovery, Monitor or Rule (depending on Object Type) in Management Pack Objects.

    Retrieve the script content

    To retrieve the script you can run the following SQL query on the OperationsManager database.

     SELECT 
             ManagementPackId,
             ScriptName,
             ScriptFile
     FROM (        
             SELECT 
                     ManagementPackId,
                     Script.Col.value('(Name/text())[1]', 'NVARCHAR(128)') AS ScriptName,
                     Script.Col.value('(Contents/text())[1]', 'NVARCHAR(MAX)') AS ScriptFile
             FROM (SELECT ManagementPackId, CONVERT(XML, MPXML) AS MPXMLFormat, MPName FROM ManagementPack) p 
             CROSS APPLY p.MPXMLFormat.nodes('//File') Script(Col)
             WHERE p.MPName LIKE '%2005R2%') s
     WHERE s.ScriptName = 'CheckVirtualMachineNameMatchComputerName.vbs'

    Take note that SQL 2005 Studio has a limit of (about) 8000 char for its return results. Also since the MPXML field of the ManagementPack table is not of type XML but NVARCHAR, the formatting isn't really fancy. However it might give you a quick impression of what the script is about.

    If people find this a useful query, I can work out one which gives a nice formatted output of the script content.

    In XML

    If you want to see how it is build up and configured in XML than

    • Export MP (Powershell Export-ManagementPack)
    • In .xml search for <Rule ID="Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineName_does_not_match_computer_name.rule"

    This looks like

           <Rule ID="Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineName_does_not_match_computer_name.rule" Enabled="true" Target="Windows! Microsoft.Windows.Computer" ConfirmDelivery="false" Remotable="true" Priority="Normal" DiscardLevel="100">
             <Category>AvailabilityHealth</Category>
             <DataSources>
               <DataSource ID="DS" TypeID="Microsoft.Virtualization.VirtualServer.2005R2.CheckVirtualMachineName">
                <IntervalInSeconds>60</IntervalInSeconds>
                 <Expression>
                   <And>
                     <Expression>
                       <SimpleExpression>
                         <ValueExpression>
                           <XPathQuery Type="String">Property[@Name='IsVirtualMachine']</XPathQuery>
                         </ValueExpression>
                         <Operator>Equal</Operator>
                         <ValueExpression>
                           <Value Type="String">True</Value>
                         </ValueExpression>
                       </SimpleExpression>
                     </Expression>
             ...

    Here you find all the properties of the (in this case) the rule. Actually you can read the workflow of this object here. One part of the workflow is the Databasource ModuleType

     <DataSource ID="DS" TypeID="Microsoft.Virtualization.VirtualServer.2005R2.CheckVirtualMachineName">

    This points to the ModulesType part of the XML file

          <ModuleTypes>
           <DataSourceModuleType ID="Microsoft.Virtualization.VirtualServer.2005R2.VirtualServerVirtualMachineDiscovery" Accessibility="Internal" Batching="false">
           <DataSourceModuleType ID="Microsoft.Virtualization.VirtualServer.2005R2.RelVirtualMachineComputerDiscovery" Accessibility="Internal" Batching="false">
           <DataSourceModuleType ID="Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineComputerDiscovery" Accessibility="Internal" Batching="false">
           <DataSourceModuleType ID="Microsoft.Virtualization.VirtualServer.2005R2.VirtualMachineState" Accessibility="Internal" Batching="false">
           <DataSourceModuleType ID="Microsoft.Virtualization.VirtualServer.2005R2.CheckVirtualMachineName" Accessibility="Internal" Batching="false">
            <Configuration>
              <IncludeSchemaTypes>
                <SchemaType>System!System.ExpressionEvaluatorSchema</SchemaType>
              </IncludeSchemaTypes>
              <xsd:element name="IntervalInSeconds" type="xsd:integer" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
              <xsd:element name="Expression" type="ExpressionType" xmlns:xsd="http://www.w3.org/2001/XMLSchema" />
            </Configuration>
            <OverrideableParameters>
              <OverrideableParameter ID="IntervalInSeconds" Selector="$Config/IntervalInSeconds$" ParameterType="int" />
            </OverrideableParameters>
           ....

    Here you will find the Module itself which is executed

                 <MemberModules>
                   <DataSource ID="DS" TypeID="System!System.CommandExecuterPropertyBagSource">
                     <IntervalSeconds>$Config/IntervalInSeconds$</IntervalSeconds>
                     <ApplicationName>%windir%\system32\cscript.exe</ApplicationName>
                     <WorkingDirectory />
                     <CommandLine>/nologo $file/CheckVirtualMachineNameMatchComputerName.vbs$</CommandLine>
                     <TimeoutSeconds>30</TimeoutSeconds>
                     <RequireOutput>true</RequireOutput>
                     <Files>
                       <File>
                         <Name>CheckVirtualMachineNameMatchComputerName.vbs</Name>
                         <Contents>        
     ' Copyright (c) Microsoft Corporation. All rights reserved.
     ' VBScript source code
     ' CheckVirtualMachineNameMatchComputerName.vbs
     ' Arg 0 : SourceID
     Option Explicit 
    
    
     Const StrVMMManagementGroupInstallationRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Setup\InstallPath"
     Const StrVirtualServerRegKey = "HKLM\System\CurrentControlSet\Services\Virtual Server\Start"
     Const StrVMMServerInstallationRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Setup\InstallPath"
     Const StrVMMServerVersionRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Setup\ProductVersion"
     Const StrVMMSelfServiceServerInstallationRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Self-Service  Portal\Setup\InstallPath"
     Const StrVMMSSsiteEngineMachineRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Self-Service  Portal\Settings\VmmServerName"
     Const StrVMMDatabaseServerRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Settings\Sql\OnRemoteServer"
     Const StrVMMDatabaseNameRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Settings\Sql\DatabaseName"
     Const StrVMMDatabaseInstanceRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Server\Settings\Sql\InstanceName"
     Const StrVMMRemoteDatabaseMachineFQDNRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007  Server\Settings\Sql\MachineFQDN"
     Const StrVMMConsoleInstallationRegKey = "HKLM\SOFTWARE\Microsoft\Microsoft System Center Virtual Machine Manager 2007 Administrator Console\Setup\InstallPath"
     Const StrVMNameRegKey = "HKLM\SOFTWARE\Microsoft\Virtual Machine\Guest\Parameters\VirtualMachineName"
    
    
     Const StrWebsitDisplayName = "Microsoft System Center Virtual Machine Manager 2007 Self-Service Portal"
     Const StrSQLServerDefaultInstance = "MSSQLSERVER"
     Const StrEmpty = ""
     Const StrFolderSeparator = "\"
     Const StrLocationHost = "Host"
     Const StrLocationLibrary = "Library"
    
    
     '=============
     ' Method:       ReadRegistry
     ' Description:  This function read the regiestry, return true if the registry exit; otherwise return false
     '=============
     Function ReadRegistry(ByVal regString, ByRef regValue)
         Dim bHasRegistry
         Dim oReg
         Set oReg = CreateObject("WScript.Shell")   
    
    
         On Error Resume Next    
         regValue = oReg.RegRead(regString)
         If Err.number &lt;> 0 Then
             bHasRegistry = False
         Else
             bHasRegistry = True
         End If
         On Error Goto 0 
    
    
         ReadRegistry = bHasRegistry
     End Function 
    
    
     Call Main()
    
    
     ... 
  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Deleting OpsMgr Attributes

    • 1 Comments

    Have you ever looked for a way to delete an Attribute you created (by accident)? I did today, when I was making some documentation about a Management Pack I created.

    As you can see there is no Delete option in the Authoring Pane of the OpsMgr Console.

    image

    So what’s the easiest and fasted way to delete an OpsMgr Attribute?

    Answer: Using the Authoring Console.

    How?

    1. Backup Management Pack where Attribute is saved in case you need to restore!
    2. Open Authoring Console
    3. Import Management Pack from Management Group where you saved the Attribute (in my case the Default MP)
      image
    4. Go to Health Model Pane
    5. Select Discoveries Folder and delete (HowToRemoveAttributeDiscovery) Discovery.
      image
    6. Click Yes when asked.
      image
    7. Open Service Model Pane in Authoring Console and click on Class Folder
      image
    8. Select Class (Windows Server_Extended in this case) and Delete
      image
    9. And click yes again when asked.
      image
    10. Select Export Management Pack to Management Group
      image
    11. Select correct Management Group and click Connect.
      image
    12. Check if Attribute is gone ;-)
      image
  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    OpsMgr 2012: Update Rollup 3 ships, and my experience installing it

    • 6 Comments

    Because Kevin Holman has not published a blog article on the latest release of the Update Rollup 3 for System Center 2012 for Operations Manager 2012 I thought why should not I do it this time Smile

    And to be honest this time was a little different then I’ve implemented updates in years. Why?

    Because this UR3 is automatically installed via Windows Update if you have enabled Windows Updates on all your OpsMgr 2012 machines off course.

    Let’s first have a look at what has been fixed in this UR3 for System Center Operations Manager 2012 (KB2750631)

    • Issue 1
      When you use the 32-bit version of Windows Internet Explorer to start a web console, the Microsoft.EnterpriseManagement.Presentation.Controls.SpeedometerGaugeUIController controller does not work correctly.
    • Issue 2
      When you run a Windows PowerShell cmdlet, you receive the following error message: 
      Get-BPAModel is not recognized as the name of a cmdlet.
    • Issue 3
      When you try to change a URL in the "web application availability monitoring" template instance, the change is not applied.

    Not that much has been fixed in the UR3 but we still want to check if our machines have these fixes installed and if we need to do some steps our selves.

    How do I check if these fixes have been installed via Windows Update?

    That’s pretty easy, just go to your OpsMgr 2012 servers and open Windows Update and have a look at the Update History

    Let’s have a look at one of my Management Servers:

    image

    You can also use PowerShell if you want using the following commands:

    Get-Content $env:windir\windowsupdate.log |  
        Where-Object { $_ -like '*successfully installed*Update Rollup 3 for System Center 2012*'} |  
            Foreach-Object { $_ | select @{L="InstallDate";E={$_.Split("`t")[0]}}, @{L="Description";E={$_.Split("`t")[16]}} } |
                Format-Table * -Wrap

     

    image

    And this is the result on my other Management Server:

    image

    You can also look at the file version for some of the updated files, just like Kevin showed you in his previous posts on Update Rollups.

     

    Checking the updated files for the Management Server Role:

    Get-ItemProperty -Path "c:\Program Files\System Center 2012\Operations Manager\Server\*.dll" | select -ExpandProperty VersionInfo | where {$_.FileVersion -eq "7.0.8560.1036"} | Format-List FileName, FileVersion

    image

    You should see files with a File Version of 7.0.8560.1036

    This means that the Management Server UR3 update has been installed on this Management Server.

    Checking the updated files for the Web Console Role:

    Get-ItemProperty -Path "c:\Program Files\System Center 2012\Operations Manager\WebConsole\WebHost\bin\*.dll" | select -ExpandProperty VersionInfo | where {$_.FileVersion -eq "7.0.8560.1036"} | Format-List FileName, FileVersion

    image

     

    Checking the updated files for the Console Role:

    Get-ItemProperty -Path "c:\Program Files\System Center 2012\Operations Manager\Console\*.dll" | select -ExpandProperty VersionInfo | where {$_.FileVersion -eq "7.0.8560.1036"} | Format-List FileName, FileVersion

    image

    Checking the updated files for the Console Role:

    Get-ItemProperty -Path "c:\\Program Files\System Center 2012\Operations Manager\Reporting\Tools\*.*" | select -ExpandProperty VersionInfo | where {$_.FileVersion -eq "7.0.8560.1036"} | Format-List FileName, FileVersion

    image

    Checking if the following Management Packs are updated:

    The Management Packs for UR3 can be found in the following folder:

    C:\Program Files\System Center 2012\Operations Manager\Server\Management Packs for Update Rollups

    In this folder you find the following Management Pack files:

    • Microsoft.SystemCenter.DataWarehouse.Library.mp (version 7.0.8427.1)

    • Microsoft.SystemCenter.Visualization.Library.mpb (version 7.0.8560.1036)

    • Microsoft.SystemCenter.WebApplicationSolutions.Library.mpb (version 7.0.8560.1036)

    When you check if these Management Packs are already installed this does not seem the case.

    Get-SCOMManagementPack | where {($_.Name -eq "Microsoft.SystemCenter.DataWarehouse.Library") -or ($_.Name -eq "Microsoft.SystemCenter.Visualization.Library") -or ($_.Name -eq "Microsoft.SystemCenter.WebApplicationSolutions.Library")} | ft Name, Version -AutoSize

     

    image

     

    So we need to install the latest Management Packs Microsoft.SystemCenter.Visualization.Library and Microsoft.SystemCenter.WebApplicationSolutions.Library from the UR3 update manually using PowerShell.

    Remark: During one the previous Update Rollups my Microsoft.SystemCenter.DataWarehouse.Library.mp (version 7.0.8427.1) was already updated to version 7.0.8427.1.

    PS C:\Program Files\System Center 2012\Operations Manager\Server\Management Packs for Update Rollups> Get-ChildItem -Filter *.mpb | Import-SCOMManagementPack -PassThru

    image

    Latest MPs have been installed.

     

    Checking if the Agents are updated with the latest updates:

     

    Check the Pending Management Pane for Agents that need an update.

    image

    Approve Agent using PowerShell

    Get-SCOMPendingManagement | Approve-SCOMPendingManagement –ActionAccount (Get-Credential)

     

     

    image

    image

    image

    Now I only need to install manually the UR3 update on my Agent in my DMZ.

    Have fun with UR3!

    Links:

  • Stefan Stranger's Weblog - Manage your IT Infrastructure

    Using SQL Nexus to troubleshoot OpsMgr SQL Server performance issues

    • 3 Comments

    SQL Nexus is a tool that helps you identify the root cause of SQL Server performance issues. It loads and analyzes performance data collected by SQLDiag and PSSDiag. It can dramatically reduce the amount of time you spend manually analyzing data.

    With the RML Utilities you can answer questions such as the following:

    • Which application, database or login is consuming the most resources, and which queries are responsible for that.
    • Whether there were any plan changes for a batch during the time when the trace was captured and how each of those plans performed.
    • What queries are running slower in today's data as compared to a previous set of data.

    If you think you have OpsMgr SQL Server performance issues maybe SQL Nexus together with SQLDiag and RML Utilities can help with performance tuning and analysis.

    Steps:

    1. Download SQLNexus , RML Utilities for SQL Server, Microsoft Report Viewer 2008 Redistributable and PerfStatsScript from websites.
    2. Install Microsoft Report Viewer 2008 Redistributable
      image
    3. Install RML Utilities for SQL Server.
      image
    4. Install\Run SQLNexus by running sqlnexus.exe in folder where you extracted the zipfile.
    5. Connect to SQL server
      image
    6. After starting SQLNexus a new database sqlnexus is created.
      image
    7. Create a folder SQLDiag and Unzip PerfStatsScript files to folder.
    8. Open StartSQLDiagTrace.cmd and change configuration as needed.
      image
    9. Give SQL server service account full control on D:\SQLDIAG folder if you aren’t using the local system account.
    10. Start D:\SQLDiag\StartSQLDiagTrace.cmd. This script registers sqldiag as a service and starts the service with a template (both profiler and perfmon trace)
      Output is being dumped in D:\SQLDiag\SQLDiagOutput folder
      image
      image

      Remark:
      On a busy system quite some data can be collected!!!!. Watch your freespace carefully! Customer experience on opsmgr environment with 2500 agents 20GB of data is collected in 10 minutes.
      Have it running for 10 mins and then stop the SQLDiag service.
    11. Stop SQLDiag with StopSQLDiagTrace.cmd script.

      image
    12. Importing trace data by selecting File\Import in SQLNexus tool.
      image

      Select Options and select BLG Blaster on Enabled and Drop Current DB before Importing.

       image

      image

      Remark: If you are getting the Message PerfStatsAnalysis.sql doesn’t exist message. Just copy the PerfStatsAnalyis.sql file to the requested folder.

      image

      image
    13. The Next Reports are available:
      • Via SQLNexus
        1. Bottleneck Analysis
        2. Blocking and Resource Wait Statistics
        3. Performance Overview with subreports
          • Resource Consumption
          • Unique Batch TopN
          • Interesting Events

    image


     image

        I want to thank David Scheltens for showing me how to use SQL Nexus and creating the PerfStatsScripts.

        References:

        SQLNexus

        http://www.codeplex.com/sqlnexus

        SQLDiag (installed default with SQL2005 and SQL2008)

        http://msdn.microsoft.com/en-us/library/ms162833(SQL.90).aspx

        PSSDiag (to use with SQL2000)

        http://msdn.microsoft.com/en-us/library/aa175399(SQL.80).aspx

        RML Utilities

        http://blogs.msdn.com/psssql/archive/2007/12/18/rml-utilities-for-microsoft-sql-server-released.aspx

      1. Stefan Stranger's Weblog - Manage your IT Infrastructure

        Microsoft Script Explorer for Windows PowerShell (pre-release)

        • 0 Comments

        Today we released the Microsoft Script Explorer for Windows PowerShell (pre-release).

        Microsoft Script Explorer for Windows PowerShell (pre-release) helps scripters find Windows PowerShell scripts, snippets, modules, and how-to guidance in online repositories such as the TechNet Script Center Repository, PoshCode, local or network file systems and Bing Search Repository.

        System requirements

        Supported Operating Systems: Windows 7 Service Pack 1, Windows 8 Consumer Preview, Windows Server 2008 R2 SP1, Windows Server 2008 Service Pack 2, Windows Server 8 Beta, Windows Vista Service Pack 2

        Additional Requirements:

        • Windows PowerShell 2.0/3.0 ISE (Client computer that is to run Script Explorer as an add-on)
        • Microsoft .NET Framework 4

        Additional information

        This software is a pre-release version. Features and behavior are likely to change before the final release.
        This preview release is designed to enable the community to experience and review the preliminary designs and direction of key features in Microsoft Script Explorer and to solicit feedback before features are finalized. If you have additional questions, need help in troubleshooting issues, and other product features visit the Microsoft Script Explorer Forum on TechNet. Your feedback is important to us. Help improving Script Explorer by submitting bugs and suggestions to Microsoft Script Explorer Forum on TechNet.

        image

         

        image

         

        And start searching for your PowerShell scripts.

        image

         

        Please give use feedback on the Microsoft Script Explorer Forum on TechNet.

        Thanks!

      2. Stefan Stranger's Weblog - Manage your IT Infrastructure

        Checking Server Roles with PowerShell

        • 4 Comments

        Today I’m rebuilding some of my demo servers in my demo environment and before I can install the software, some pre-requisites need to be checked. You need to check if some Windows Server Roles are installed before starting the installation.

        Off course you can just use the Server Manager to check the Roles and if necessary install the missing server roles.

        imagec

        But it’s much cooler to use PowerShell to check if you have installed the needed server roles Winking smile

        Just open Windows PowerShell, load the ServerManager Module and run the Get-WindowsFeature Cmdlet. That’s all to it.

        image

        And if you want to can also add the missing roles using the Add-WindowsFeature Cmdlet.

        Have fun learning PowerShell!

      3. Stefan Stranger's Weblog - Manage your IT Infrastructure

        OpsMgr Crossplatform Logging on the Unix Agent

        • 0 Comments

        I’m currently busy with learning more about Crossplatform monitoring with OpsMgr 2007 R2 and stumbled on Logging on the Unix Agent for troubleshooting issues. As you may know on the Linux agent you can troubleshoot, manage and manually control the agent by using the scxadmin tool.

        /opt/microsoft/scx/bin/tools/scxadmin -stop [all|cimom|provider]
        /opt/microsoft/scx/bin/tools/scxadmin -start [all|cimom|provider
        /opt/microsoft/scx/bin/tools/scxadmin -restart [all|cimom|provider]

        You can view the running status by executing:
        /opt/microsoft/scx/bin/tools/scxadmin -status [all|cimom|provider]

        image

        And you can view the agent version by executing:
        /opt/microsoft/scx/bin/tools/scxadmin –version

         

        You can enable debug level logging on all 3 components - wsman, cimom (openPegasus) and the providers. The following command creates the necessary entries in the agent configuration for logging:
        /opt/microsoft/scx/bin/tools/scxadmin -log-set [all|cimom|provider] {verbose | intermediate | errors}

        The following logs are created in /var/opt/microsoft/scx/log:

        • scx.log
        • scxcimd.log
        • cimserver.trc
        • cimserver.trc.SCXCoreProviderModule.root

         

        image

        The initial Linux Logging setting shows this:

        image

        As you can see no logging is currently configured.

        When we change the logging level to verbose for all components the logging level changes to TraceLevel 4.

        image

        Let’s have a look at the log files first to see what’s happening now.

        image

        You can see the log file size is growing fast ;-)

        Ok, after you have found what you are looking for you want to stop the Linux Agent logging. But how do you stop the Linux Agent Logging?

        According to the scxadmin  --help you can stop the logging with the next commando: scxadmin –log-reset

        image

        Let’s run that command now and check the new settings.

        image

        Huh? Even though we did a –log-reset according to the –log-list the traceLevel is still 1.

        If we look at the log files for info if there is still logging going on we see that no logging is taking place after the –log-reset. The reason why the –log-list command still shows a tracelevel of 1 is due to explicit config files (/etc/opt/microsoft/scx/conf/cimserver_current.conf). So you can ignore the tracelevel=1 in the –log-list of scxadmin after enabling and resetting logging on a Linux Agent.

        image

        Have fun with OpsMgr and Crossplatform monitoring.

      4. Stefan Stranger's Weblog - Manage your IT Infrastructure

        Updated version: Download MMS 2013 Videos from Channel 9

        • 10 Comments

        Sitting at the McCarran International Airport waiting for my flight to Amsterdam (the Netherlands) I had some time to kill so I wrote a simpel PowerShell script which helps to easily download the MMS 2013 sessions from the Channel 9 RSS feed.

        Using the Out-GridView Cmdlet you can easily select the sessions you are interested in. Click on Ok when finished selecting the sessions you are interested in downloading.

         

        image

        After creating my initial version I got some feedback that sometimes the script did not work and with the help of Jamie Moyer (also a Senior PFE like me) we made the script more robust and added extra features like a HTML Report overview.

        You can even use the –verbose switch and other parameters to tweak the download folder. We hope you like the improvements.

        #######################################################################################################################                        
        # Description:   Download MMS 2013 Channel 9 videos
        # PowerShell version: 3                   
        # Author(s):     Stefan Stranger (Microsoft)
        #                Jamie Moyer (Microsoft          
        # Example usage: Run Get-MMS2013Channel9Videos.ps1 -path c:\temp -verbose
        #                Select using the Out-Gridview the videos you want to download and they are stored in your myvideos folder.
        #                You can multiple select videos, holding the ctrl key.
        # Disclamer:     This program source code is provided "AS IS" without warranty representation or condition of any kind
        #                either express or implied, including but not limited to conditions or other terms of merchantability and/or
        #                fitness for a particular purpose. The user assumes the entire risk as to the accuracy and the use of this
        #                program code.
        # Date:          04-13-2012                        
        # Name:          Get-MMS2013Channel9Videos.ps1            
        # Version:       v1.001 - 04-14-2012 - Stefan Stranger - initial release
        # Version:       v1.005 - 04-29-2013 - Jamie Moyer, Stefan Stranger - added more robustness and HTML Report
        ########################################################################################################################
        #requires -version 3.0
        
        [CmdletBinding()]
        Param
        (
                # Path where to store video's locally
                [Parameter(Mandatory=$false,
                           Position=0)]
                $Path = [environment]::getfolderpath("myvideos") + "\MMS2013",
                [Parameter(Mandatory=$false,
                           Position=1)]
                $rssfeed = "http://channel9.msdn.com/Events/MMS/2013/RSS"
            )
        
        function Get-NewFileName($name)
        {
            Write-Verbose "Calling Get-NewFileName Function"
            $r=$Path+"\"+(($name -replace "[^\w\s\-]*") -replace "\s+") + ".wmv";$r
        }
        
        Write-Verbose "Remove last slash if added using the downloaddirectory Parameter"
        if ($path.EndsWith("\")){$path = $path.Substring(0,$path.Length-1)}
        write-verbose "Path is: $path"
        
        Write-Verbose "Checking if Download directory $Path exists"
        if(!(test-path $Path -PathType Container))
        {
            Write-Verbose "Creating $Path"
            New-Item -ItemType Directory $Path | Out-Null
        }
        
        Write-Verbose "Downloading RSS Feed Items from $rssfeed"
        $feeditems = Invoke-RestMethod $rssfeed
        [array]$feeditemsWithDetails = $feeditems | 
            select Title, Summary, Duration, Enclosure,creator | 
                Add-Member -MemberType ScriptProperty -Name AlreadyDownloaded -Value {(test-path("$Path\$($this.enclosure.url.split('/')[6])"))} -PassThru -Force |
                Add-Member -MemberType ScriptProperty -Name Destination -Value {("$Path\$($this.enclosure.url.split('/')[6])")} -PassThru -Force |
                Add-Member -MemberType ScriptProperty -Name Source -Value {$this.enclosure.url} -PassThru -Force |
                    select AlreadyDownloaded,Title, Summary, Duration, Enclosure,Source,Destination,creator | sort Title
        
        Write-Verbose "Add all already downloaded items back to the list"
        $duplicateVideoNames = $feeditemsWithDetails |sort name| group destination | where-object {$_.Name -ne "" -and $_.Count -gt 1} | 
            ForEach-Object {$_.Group}
        
        Write-Verbose "Remove the posts with duplicate file names from the feeditemsSelected array"
        $feeditemsSelected = @($feeditemsSelected | Where-Object {$duplicateVideoNames -notcontains $_})
        
        Write-Verbose "Change video names to filenames, check to see if they are downloaded already and added them back to the array with updated details"
        $duplicateVideoNames | foreach-object {
                                                $newDestination = Get-NewFileName $_.Title
                                                $_.Destination = $newDestination
                                                $_.AlreadyDownloaded = (Test-Path $newDestination)
                                                $feeditemsWithDetails += $_
                                              }
        
        Write-Verbose "Open Out-GridView to select vidoes to download"
        [array]$feeditemsSelected = $feeditemsWithDetails| Out-GridView -PassThru | 
            select AlreadyDownloaded,Title, Summary, Duration, Enclosure,Source,Destination
        
        Write-Verbose "Downloading videos"
        $feeditemsSelected |Where-Object{!(Test-Path $_.Destination)} | 
            select Source,Destination | 
                Start-BitsTransfer -Priority Normal | Out-Null
        
        Write-Verbose "Add all already downloaded items back to the list"
        $feeditemsWithDetails | where-object {$_.AlreadyDownloaded} | 
                                    foreach-object {
                                                        if(-not [bool]($feeditemsSelected | Select-String $_.Title -Quiet))
                                                        {
                                                            $feeditemsSelected += $_
                                                        }
                                                   }
        
        Write-Verbose "Create HTML Report"
        $feeditemsSelected | sort Name | Out-Null
        $html = $feeditemsSelected |?{Test-Path "$($_.Destination)"} | % {@"
             <H4><a href="$($_.Destination)">$($_.Title)</a></H4> 
             <H5>Speaker(s): $($_.creator)</H5>
             <H5>$($_.Summary)</H5>
        "@}
        
        Write-Verbose "Open HTML Report"
        ConvertTo-Html -Head "<h1>My Downloaded MMS Videos - $($feeditemsSelected.Count) Downloaded</h1>" -Body $html | 
            Out-File $Path\MyMMSContent.html;start "$Path\MyMMSContent.html"

        image

        Have fun!

      5. Stefan Stranger's Weblog - Manage your IT Infrastructure

        New PowerShell Event Creator for Operations Manager 2007

        • 2 Comments

         

        Did you remember the Event Creator for MOM 2005 which was available in the Resource Kit? You could use this tool to create events for testing Management Packs. Event Creator enables you to choose event sources for the existing event logs that are currently registered. You can probably use this tool also for testing in your OpsMgr environment but why not use PowerShell?

        You have at least installed PowerShell on you Management Server(s) so why not use PowerShell to create events for testing?

        With some help from the PowerShell Guy I created a PowerShell script to create events in the eventlog.

        # Description:     Create Events in Application log
        # Date:                03-05-2007
        # Author:            Stefan Stranger
        # Explanation:    If you only wish to write to the event log you must do two things. The first is to create or specify a Source. 
        #                         The second is to call the WriteEntry method. The source would be your application name, by default,
         
        #                         if you create a source that is new then your log entry will be written to the Application Log.
         
        #                         To WriteEntry method does the actual writing to the Event Log.

        #                         ev.WriteEntry(My event text, System.Diagnostics.EventLogEntryType.Information, myeventid)

        #Check if user is admin
        function get-Admin {
         
        $ident = [Security.Principal.WindowsIdentity]::GetCurrent()
         
         
        foreach ( $groupIdent in $ident.Groups ) {
         
        if ( $groupIdent.IsValidTargetType([Security.Principal.SecurityIdentifier]) ) {
          
        $groupSid = $groupIdent.Translate([Security.Principal.SecurityIdentifier])
          
        if ( $groupSid.IsWellKnown("AccountAdministratorSid") -or $groupSid.IsWellKnown("BuiltinAdministratorsSid")){
           
        return $TRUE
          
        }
         
        }
         
        }
         
        return $FALSE
        }

        $Result = get-Admin

        if ($Result -eq $FALSE) 
         
        {

           
        write-host "Better be an admin for this script."
           
        #exit

         
        }

        function Write-EventLog { 
           
        param ([string]$msg = $(read-host "Please enter a Event Description"), [string]$source = $(read-host "Please enter Event Source"), [string]$type = $(read-host "Please enter Event Type [Information, Warning, Error]"), [int]$eventid = $(read-host "Please enter EventID"))

           
        # Create the source, if it does not already exist.
               
        if(![System.Diagnostics.EventLog]::SourceExists($source))
               
        {
                   
        [System.Diagnostics.EventLog]::CreateEventSource($source,'Application')
               
        }
               
        else 
               
        {

                   
        write-host "Source exists"
               
        }

                
           
        # Check if Event Type is correct
           
        switch ($type) 
           
        {
         
                "Information"
        {}
         
                "Warning"
        {}
         
                "Error"
        {}
         
               
        default {"Event type is invalid";exit}

           
        }

              
           
        $log = New-Object System.Diagnostics.EventLog 
           
        $log.set_log("Application")
         
           
        $log.set_source($source)

           
        $log.WriteEntry($msg,$type,$eventid)
        }

        Write-Eventlog
        Write-Host "Event created"

        Or you can download the PowerShell script from the PowerShell Code Repository.

      6. Stefan Stranger's Weblog - Manage your IT Infrastructure

        System Center Operations Manager 2012 Toolbox

        • 7 Comments

        After posting some years ago a blog post with all the OpsMgr 2007 tools I thought it would be time for a new OM2012 Toolbox blog post.

         

        Tool Purpose Description Author Webpage
        MPViewer 2.2 MP Viewing

        The previous version 1.7 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 2.1.2 has been updated to work with OpsMgr 2012, and now includes support for MPB files (MP Bundles) as well as the ability to Unseal and Unpack MP Bundles.
        Warning: only MP Bundles that contain a single ManagementPack are supported; there are some Service Manager MPBs that contain multiple ManagementPacks in a single bundle, and this tool currently cannot deal correctly with those.

        Daniele Muscetta Link
        OverrideExplorer 3.5 MP Viewing The previous version 3.3 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 3.5 has been updated to work with OpsMgr2012 and includes some minor fixes, as well as the capability to Export all overrides to an Excel spreadsheet. Daniele Muscetta Link
        Proxy Settings 1.2 View Proxy Settings The previous version 1.1 (that works with OpsMgr 2007 and 2007 R2) was released here. Version 1.2 is functionally identical to the previous version but has been just recompiled to work with OpsMgr 2012 SDK. Daniele Muscetta Link
        Management Pack Compare Util Management Pack Compare Util

        This utility allows you to compare Management Packs between your Operations Manager and/or Service Manager environments.

        Online catalog check is also available.

        Changes in this version:

        • Added Service Manager support
        • Change to grid views
        • Clear grid option
        • More compare options
        • Colors changed to help visibility 
        • Management group versions added
        Robert Ryan Link
        SCOMTypeView for MP Developer MP Authoring

        SCOMTypeView is a tool help MPAuthor visualize ManagementPackClass, ManagementPackRelationship, showing them in treeview. The most important, you can see how the specific MonitoringObject is connected with other MonitoringObject.
        This tool connect to your local ManagementGroup, showing real data in time.
         

        Haitao Chen Link

        Coretech XML Connector for SCOM 2012

        Connector Service A connector with both two way communication and with configuration possibilities. This connector will work fine with other Monitoring systems, as well as your HelpDesk system; Remedy, Servicenow etc. CoreTech Link
        System Center 2012 Operations Manager – Alert Update Connector Connector Service

        The Alert Update Connector can modify alert custom fields with additional information useful for situations like controlling alert forwarding to incident management systems and help reduce noise in the incident creation process.

        Microsoft Link
        GTMTool Dashboard Authoring

        In OpsMgr 2012, we provided users the ability to create customized dashboards using the OpsMgr 2012 console. The GTM.exe tool provided in this blog allows you to build off these dashboard investments, in particular we allow you to accomplish three specific tasks that you cannot do via the console.

        1. Turn IT Pro Console created dashboards into shippable MPs by stripping out management group specific parameters (removes MG GUIDs from dashboard MPs)

        2. Provides the ability to have a custom dashboard show up under any Management Pack folder in the Monitoring view.

        3. Have a custom dashboard be launched from the task pane when you pick a specific computer or object.

        Satya Vel Link
        Operations Manager 2012 Sizing Helper Tool Design The OpsMgr 2012 Sizing Helper is an interactive document designed to assist you with planning & sizing deployments of System Center 2012 Operations Manager. It helps you plan the correct amount of infrastructure needed for a new OpsMgr 2012 deployment, removing the uncertainties in making IT hardware purchases and optimizes cost. A typical recommendation will include minimum hardware specification for each server role, topology diagram and storage requirement. Microsoft Link
        System Center 2012 Operations Manager (SCOM) Visio Stencil  Design  System Center 2012 Operations Manager (SCOM) Visio Stencil    Link

        Let me please know if I’m missing some other great OM2012 tools.

      7. Stefan Stranger's Weblog - Manage your IT Infrastructure

        RSS2Twitter Part 2

        • 0 Comments

        Thanks to Jeremy Pavleck I found out that Twitterfeed is much more efficient than using a PowerShell rss2twitter script. And he is right!

        image

        But I learned some PowerShell creating the rss2twitter script ;-)

      8. Stefan Stranger's Weblog - Manage your IT Infrastructure

        CU6 for System Center Operations Manager R2 Released

        • 0 Comments

        We have released CU6 for System Center Operations Manager 2007 R2.

        Cumulative Update 6 for Operations Manager 2007 R2 includes all previous cumulative updates for Operations Manager 2007 R2 and includes all cross-platform updates.

        To download Cumulative Update 6 for Operations Manager 2007 R2, go to the following Microsoft Download Center website:

        Download Cumulative Update 6 for System Center Operations Manager 2007 R2 (http://www.microsoft.com/downloads/details.aspx?FamilyID=694147f8-9691-4833-97af-0de918c60141)

        Cumulative Update 6 for Operations Manager 2007 R2 resolves the following issues:

        • RMS promotion fails if NetworkName and PrincipalNames are not in sync for agents.
        • UI is limited to only 100 MB for the Memory Usage field in the wizard.
        • Additional OIDs in auth certificate are not processed correctly.
        • AEM creates duplicate computer objects in OpsMgr based on Agents NetBIOS name.
        • Cannot open reporting pane on OpsMgr 2007 R2 remote console.
        • Cannot view schedule for scheduled report.
        • ManagementServerConfigTool with the option "promoterms" fails because it stops polling the SDK Service.
        • OpsMgr reports are failing on Windows 7 with the error: "Cannot initialize report."
        • ACS events have "n/a" as their category in the ACS database.
        • Watch agentless monitoring listener to detect failure to respond.
        • SCOM SDK memory leak on cryptography keys and cryptography contexts.
        • After you click Edit Schedule, a message box appears, and you cannot save the change value.
        • Audit events can be lost when the AdtServer process crashes.
        Cumulative Update 6 for Operations Manager 2007 R2 resolves the following cross-platform issues:
        • The installation process for the IBM AIX 6.1 agent incorrectly checks for AIX 5.3 packages.
        • After a system restart, the OpsMgr agent for Solaris may start to run before local file systems are mounted.
        • On Red Hat Linux version 4 and SUSE Linux version 9, LVM disks are not discovered and cannot be monitored.
        • The OpsMgr agent for AIX does not report the arguments for monitored processes.
        • When Microsoft security update MS12-006 is installed on an OpsMgr management server, that management server can no longer communicate with the OpsMgr agent on any Linux or UNIX server.
        • On HP-UX, OpsMgr cannot discover and monitor a logical volume that is composed of more than 127 physical volumes.
        Cumulative Update 6 for Operations Manager 2007 R2 adds the following cross-platform features:
        • Support for IBM AIX 7.1 (POWER).
        • Support for Oracle Solaris 11 (x86 and SPARC).
        Note The new agents for IBM AIX 7.1 and Oracle Solaris 11 are included in Cumulative Update 6 for Operations Manager 2007 R2. You can download the management packs for these new operating system versions by going to the following Microsoft website:

        System Center Operations Manager 2007 R2 Cross Platform Monitoring Management Packs (http://www.microsoft.com/downloads/details.aspx?FamilyID=b15fef5c-e331-4006-8913-be376bb0e0c1)

        Technorati Tags: ,
      9. Stefan Stranger's Weblog - Manage your IT Infrastructure

        Creating a System Center 2012 Operations Manager Alert RSS feed

        • 0 Comments

        In OpsMgr 2007 we had the option to create a RSS Feed for Alerts using the Operations Web Console.

        image

         

        Selecting the RSS button would return the following RSS Feed info.

        image

         

        In System Center 2012 Operations Manager (OM2012) we don’t have that option anymore. But this is not really an issue, because with a little bit of PowerShell magic,
        we can create our own OM2012 Alert RSS feed with all the Alert information we want. And that is exactly what I did when I saw an internal question about this feature
        missing in OM2012.

        Environment information:

          • System Center 2012 Operations Manager with RU1 installed
          • Two Management Servers (OM12MS01 and OM12MS02)
          • OM12MS01 has the web console installed.
          • Server features installed on OM12MS01:
          • Application-Server
          • AS-NET-Framework
          • Web-Server
          • Web-WebServer
          • Web-Common-Http
          • Web-Static-Content
          • Web-Default-Doc
          • Web-Dir-Browsing
          • Web-Http-Errors
          • Web-App-Dev
          • Web-Asp-Net
          • Web-Net-Ext
          • Web-ISAPI-Ext
          • Web-ISAPI-Filter
          • Web-Health
          • Web-Http-Logging
          • Web-Request-Monitor
          • Web-Security
          • Web-Windows-Auth
          • Web-Filtering
          • Web-Performance
          • Web-Stat-Compression
          • Web-Mgmt-Tools
          • Web-Mgmt-Console
          • Web-Mgmt-Compat
          • Web-Metabase
          • NET-Framework
          • NET-Framework-Core
          • RSAT
          • RSAT-Role-Tools
          • RSAT-Web-Server
          • PowerShell-ISE
          • WAS
          • WAS-Process-Model
          • WAS-NET-Environment
          • WAS-Config-APIs

          Pre-requisites:

          What is PowerShel PipeWorks?

          PowerShell Pipeworks is a Framework for making Sites and Services with Windows PowerShell. Read more about Pipeworks here.

           

          Installation steps for creating an OM2012 Alert RSS feed

          1. Download PowerShell PipeWorks Module.
          2. Copy Module to Management Server where you have installed:

          • OM2012 Management Server with Console
          • PowerShell v2.0 or higher
          • ASP.NET

          3. Unblock PipeWorks.1.0.2.6.zip file before extracting (you can also use the PowerShell v3 unblock-file Cmdlet if you have PowerShell v3 installed)
          image

          4. Extract the PipeWorks Module to your default PowerShell Module folder.
              You can check the default folders where PowerShell is looking for PowerShell modules using the following PowerShell command:
            

          $env:psmodulepath   


                  image
             
              I personally have created a D:\PowerShell\Modules folder to store the PipeWorks Module and added that path to my psmodulepath variable.
              You can add a new Module Path using the following Command in PowerShell:
            

          $env:PSModulePath = $env:PSModulePath + ";D:\PowerShell\Modules"

              image

          5. Create an IIS Application Pool for PipeWorks
              image
              
              image
             
              Change the Identity of the Application Pool to use the OM2012 SDK Account (Microsoft System Center Data Access Service account).
              image    image

          6. Add PipeWorks Application
              image

              Enter Alias and Select previously created Application Pool. Enter Physical Path where to store the later to be created OM2012 RSS Alert files.
              Create Folder PipeWorks (C:\inetpub\wwwroot\PipeWorks)  if that folder does not exist.
              image

          And configure the OM12_SDK Account to connect as configuration.

          image

          And finally Test Connection.
          image

           

          7. Use PipeWorks Module to create an OM2012 Alert Web Service, which we can use as an RSS Feed.
              a. Open PowerShell ISE
              b. Load PowerShell PipeWorks Module in PowerShell ISE.
                 

          import-module PipeWorks -verbose

             c. Create the following Function in the PowerShell ISE:

          function Get-MySCOMAlert {
                  <#
                  .Synopsis
                      Shows SCOM Alerts
                  .Description
                      Shows SCOM Alerts for OM2012
                  .Example
                      Get-MySCOMAlert
                  .Example
                      Get-MySCOMAlert -ResolutionState New
                  .Example
                      Get-MySCOMAlert -ResolutionState Closed
                  #>
                  [CmdletBinding()]
                  param
                  (
                  [Parameter(Mandatory=$True,
                  ValueFromPipeline=$True,
                  ValueFromPipelineByPropertyName=$True,
                    HelpMessage='What is the ResolutionState of the Alerts you want to filter on?')]
                  [string[]]$ResolutionState,
                  [int]$First=50
                  )
                  process
                  {
                      if(!(Get-Module OperationsManager))
                      {
                          Import-Module OperationsManager
                      }
                      #To convert string ResolutionStates to integers
                      switch ($ResolutionState) {
                          New {[int]$ResolutionState = 0}
                          Closed {[int]$ResolutionState = 255}
                          default {return "$($ResolutionState) is unknow ResolutionState"}
                      } #end Switch
                      Get-scomalert -ResolutionState $ResolutionState | sort -Property TimeRaised -Descending | select Severity, Priority, Name, TimeRaised -First $First
                  } #end Process
          }

          image

          We can test the Function by selecting the function and hitting F8
          Running the following command: Get-MySCOMAlert -ResolutionState "New" -First 2 returns the latest 2 OM2012 Alerts with ResolutionState New.
          image

          d. Convert Function to PipeWorks Web Service by running the following PipeWorks Command:
             

          ConvertTo-CommandService -Command (Get-Command Get-MySCOMAlert) -RunOnline -OutputDirectory C:\inetpub\wwwroot\PipeWorks\Get-MySCOMAlert -Force

          e. Check the Web Service in your Web browser by running the following command from the PowerShell ISE

          Start-Process http://localhost/PipeWorks/Get-MySCOMAlert

          You should see something like this:
          image

          You can now test the Get-MySCOMAlert Web Service by entering a ResolutionState and First (number of Alerts you want to return)
          image

          Result:
          image

          8. Retrieve RSS feed URL.
              Now we have created the Get-MySCOMAlert Web Service we can add some parameters to retrieve the RSS Feed for the OM12 Alerts.
             

          http://localhost/PipeWorks/Get-MySCOMAlert/?Get-MySCOMAlert_ResolutionState=New&Get-MySCOMAlert_First=2&-AsRSS=true

          This will return the RSS Feed for all OM2012 Alerts with a ResolutionState of new and only shows the last 2 new Alerts.

          image

           

          Have fun and let me know some other cool things you have created using PowerShell PipeWorks!!

          DISCLAIMER: THIS PROGRAM SOURCE CODE IS PROVIDED "AS IS" WITHOUT WARRANTY REPRESENTATION OR CONDITION OF ANY KIND EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO CONDITIONS OR OTHER TERMS OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. THE USER ASSUMES THE ENTIRE RISK AS TO THE ACCURACY AND THE USE OF THIS PROGRAM CODE OR RESULTING EXECUTABLE CODE

        • Stefan Stranger's Weblog - Manage your IT Infrastructure

          Released - Technical Documentation Download for System Center 2012 – Operations Manager

          • 1 Comments

          Just a short blogpost to let you know we released the Technical Documentation Download for System Center 2012 – Operations Manager. Go to Microsoft Download Center and download the following documentation.

          Overview

          The downloadable files listed on this page contain the product documentation for the Operations Manager component of System Center 2012. The available downloads include:

          • Authoring Guide for System Center 2012 - Operations Manager - last updated April 1, 2012
          • Deployment Guide for System Center 2012 - Operations Manager - last updated April 1, 2012
          • Operations Guide for System Center 2012 - Operations Manager - last updated April 1, 2012
          • System Center 2012 – Operations Manager Cmdlet Reference - last updated April 1, 2012

           

          And for you lazy people who don’t want to click for each download I again created a PowerShell script to download them all in on go Winking smile

          ###############################################################################
          # Download all OM12 Documents from
          # http://www.microsoft.com/download/en/details.aspx?displaylang=en&id=29256
          # in one-go using PowerShell and BitsTransfer.
          # Remark: Use PowerShell 2.0 because it makes use of the BitsTransfer Module
          # Author: Stefan Stranger
          # v1.002 - 01/04/2012 - stefstr - second release
          ###############################################################################

          $outputfolder = "c:\Temp\OM12Docs"

          Import-Module BitsTransfer #Loads the BitsTransfer Module
          Write-Host "BitsTransfer Module is loaded"

          $OM12Docs = @("http://download.microsoft.com/download/3/3/F/33F52373-3A75-422C-969B-61E05EEC5E72/SC2012_OpsMgr_Operations.docx",
                              "http://download.microsoft.com/download/3/3/F/33F52373-3A75-422C-969B-61E05EEC5E72/SC2012_OpsMgr_Authoring.docx",
                              "http://download.microsoft.com/download/3/3/F/33F52373-3A75-422C-969B-61E05EEC5E72/SC2012_OpsMgr_Cmdlets.doc",
                              "http://download.microsoft.com/download/3/3/F/33F52373-3A75-422C-969B-61E05EEC5E72/SC2012_OpsMgr_Deployment.docx")
          Foreach ($OMDoc in $OM12Docs) { Start-BitsTransfer -source $OMDoc -Destination $outputfolder}
          Write-Host "OM12 Docs are downloaded to $outputfolder"

        • Stefan Stranger's Weblog - Manage your IT Infrastructure

          Check if new Management Packs have been received using PowerShell

          • 0 Comments

          Today I deployed some new Management Pack in my OM2012 demo environment, and to check if the Management Packs got deployed I checked the Operations Manager Eventlog for eventid 1201.

          And because I do this every time when I deploy new Management Packs I created a PowerShell script to check for these events. This is why we invented PowerShell Smile

           

          I wanted to know which Management Packs where deployed since the last hour. No need to retrieve all deployed Management Packs.

          $regex = [regex]'"(.*?)"'

          #Custom formatting
          $format = @{Label="MPName-Version";Expression={$regex.Matches($_.Message)}}

          get-eventlog -LogName "Operations Manager" -after (get-date).addhours(-1) |
              Where-Object {$_.Eventid -eq 1201} |
              Format-Table TimeGenerated, EventId, $format -AutoSize

           

          You can even add the –computername switch to retrieve remote eventids if you want.

          image 

        Page 1 of 14 (348 items) 12345»