locked
Use SCOM 2007 r2 to monitor individual Exchange 2010 Mailboxes RRS feed

  • Question

  • We are running SCOM 2007 R2 and are monitoring a few installations of Exchange 2010 on a number of domains.  All exchange 2010 organisations are pretty small.

    We need a way to get SCOM to log exchange 2010 mailbox size (that's individual mailboxes, not mailbox databases) to the performance section of the data warehouse - similar to exchange 2007 and exchange 2003.  I have seen a solution that looks at creating a scheduled task on the Exchange server and a collection rule in SCOM but don't want to go down this path if possible.  I would prefer the entire solution to be contained within a single management pack if possible.

    It seems logical that there should be a way to do this using the authoring console to a create a rule targeted at an exchange class, a data source and a timed script based probe that utilises powershell.  Unfortunately, my script based probe fails.  I suspect it is unable to connect to the exchange management shell to use the Get-MailboxStatistics cmdlet.  Is there a way to do this or do I need to go with the scheduled task option?

    Any suggestions appreciated.

    Marni

    Monday, June 25, 2012 4:04 PM

Answers

  • Never set as target any Group. RMS calculate all groups and if you set as target a group, then your script will run at RMS. You need to set as a target one of exchange server. You just can set as target "Microsoft Exchange 2010 Server", disable your monitor, load to management server and enable your monitor/rule for one of exchange server with override.



    • Edited by Vladimir Zelenov Tuesday, June 26, 2012 1:08 PM
    • Proposed as answer by Graham Davies Tuesday, June 26, 2012 1:29 PM
    • Marked as answer by M Hall Tuesday, June 26, 2012 2:56 PM
    Tuesday, June 26, 2012 1:06 PM

All replies

  • You can do it only in Authoring Console, cause you can't create PowerShell rule in Operations Console.

    Monday, June 25, 2012 7:41 PM
  • Thanks for the suggestion Bob, but as I mentioned above I have been using the authoring console so we'll need to look deeper for a solution.

    To be clear on what I've done...  In the authoring console I have... 1) created a management pack that references the exchange 2010 management pack in addition to all of the standard management packs.  2) Created a probe that runs a triggered powershell script that outputs property bags. 3) Created a data source that contains the probe.  4) Created a rule that targets Microsoft.Exchange.MailboxServers.InstanceGroup.   This rule uses the data source, passes the property bags to be converted to performance data and writes to SCOM DB and DW. 

    My script for my probe is below after the ****

    I have tested my script on an exchange 2010 server by uncommenting the line # $api.return($Bag) and it outputs property bags correctly to the screen so the script itself produces correct output if run manually on the machine as an administrator.

    If I use static values for the property bags rather than an exchange cmdlet and simulate the rule using the Authoring Tools the rule works so I'm relatively confident that my rule and data source are configured correctly, with the possible exception of an issue with rule targeting as the simulation just uses dummy target GUIDs.

    This leaves me to believe that the script contained in the probe is the failing part of the issue and specifically the part that tries to use Exchange 2010 Cmdlets is failing.

    I suspect the issue is either permissions related, poor target selection for the rule or related to some limitation of SCOM/Exchange that I am unaware of.

    ****

    Add-PSSnapin Microsoft.Exchange.Management.PowerShell.E2010

    $Mailboxes = Get-Mailbox | Get-MailboxStatistics
    foreach( $box in $mailboxes ){

     $api = new-object -comObject 'Mom.ScriptAPI'
     $bag = $api.CreatePropertyBag()

     $bag.addValue('MailboxName', $box.Displayname)
     $bag.addValue('SizeMB', $Box.totalitemsize.value.toMb())
     $bag.addValue('ItemCount', $box.itemCount)

    # $api.return($Bag)
     $bag
    }

    ****

    Now that you have a better picture can you provide further insights?


    Marni Hall

    Tuesday, June 26, 2012 9:19 AM
  • Never set as target any Group. RMS calculate all groups and if you set as target a group, then your script will run at RMS. You need to set as a target one of exchange server. You just can set as target "Microsoft Exchange 2010 Server", disable your monitor, load to management server and enable your monitor/rule for one of exchange server with override.



    • Edited by Vladimir Zelenov Tuesday, June 26, 2012 1:08 PM
    • Proposed as answer by Graham Davies Tuesday, June 26, 2012 1:29 PM
    • Marked as answer by M Hall Tuesday, June 26, 2012 2:56 PM
    Tuesday, June 26, 2012 1:06 PM