[OpsMgr] more about SCOM recipients: getting list in powershell

Posted: September 20, 2011 in SCOM, SCOM 2007

inspired by this community post: Powershell Subscribers Names – Devices / Name – address

in case you need to enumerate all SCOM 2007  R2 subscriptions and in the same time for each subscription expand Device Names and Addresses, use the following script:

Get-NotificationSubscription |%{$c=$_.ToRecipients; $b=@($c|%{$_.Name}); $d=@($c|%{$_.Devices}|%{$_.address});"'{0}' '{1}' '{2}'" -f $_.DisplayName,[string]::join(':',$b),[string]::join(':',$d) }

output will be as follows:

'Subscription'    'colon-delimeted-Subscribers'      'colon-delimeted-Addresses'
Advertisements

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