[OpsMgr] How to enumerate given recipient’s email addresses

Posted: September 11, 2009 in SCOM, SCOM 2007

As you probably know all OpsMgr 2007 Sp1/R2 Notitications/Subscrubers/Channels are stored inside unsealed management pack ID:Microsoft.SystemCenter.Notifications.Internal, Name:Notifications Internal Library. And as descriptions says: Microsoft System Center Notifications Library: This management pack is used to hide notification related management pack objects that are exposed directly via the API for Operations Manager.

I believe enumeration is possible via SDK or Powershell. If you know exact call, just drop me some words in comment.

What do we have so far?
Let’s look at powershell commands:
Get-NotificationAction – Gets notification actions.
Get-NotificationEndpoint – Gets notification end points.
Get-NotificationRecipient – Gets notification recipients.
Get-NotificationSubscription  – Gets notification subscriptions.

Non of above commands fits my needs.

Digging inside management pack itself I ended up with the following t-sql query:

declare @xml xml;
select @xml = (select MPXML from ManagementPack where MPName = ‘Microsoft.SystemCenter.Notifications.Internal’)
select t.rows.value(‘data(.)’, ‘varchar(50)’) as Email
from @xml.nodes(‘//ManagementPack/TypeDefinitions/ModuleTypes
/ConditionDetectionModuleType[@ID=”Microsoft.SystemCenter.Notification.Recipients”]
/ModuleImplementation/Composite/MemberModules
/ConditionDetection[@ID=”RecipientResolver”]/RecipientDirectory
/Recipient[Name=”_Pavel”]
/Devices/Device[Protocol=”Smtp”]/Address’) as t(rows)

declare @xml xml;

select @xml = (select MPXML from ManagementPack where MPName = ‘Microsoft.SystemCenter.Notifications.Internal’)

select t.rows.value(‘data(.)’, ‘varchar(50)’) as Email
from @xml.nodes(‘//ManagementPack/TypeDefinitions/ModuleTypes
/ConditionDetectionModuleType[@ID=”Microsoft.SystemCenter.Notification.Recipients”]
/ModuleImplementation/Composite/MemberModules
/ConditionDetection[@ID=”RecipientResolver”]/RecipientDirectory
/Recipient[Name=”<Name Goes Here>”]
/Devices/Device[Protocol=”Smtp”]/Address’) as t(rows)

Exampe output of this comand.
Email
email1@email.com
email2@email.com
email3@email.com
etc.

Advertisements
Comments
  1. loujus says:

    hi tghergedahjf

  2. Chopard says:

    Excellent beat ! I wish to apprentice whilst you amend your web site, how can i subscribe for a weblog web site? The account helped me a applicable deal. I had been a little bit acquainted of this your broadcast offered bright transparent idea

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s