locked
SCOM Get Email address by Get-NotificationRecipient RRS feed

  • Question

  • I have done a lot of searching but I am still coming up short.  I am trying to get a list of email addresses for each Recipient.

    When I run, Get-NotificationRecipient | foreach-object {$_.devices | where {$_.protocol -eq "smtp"}} | select name,address; I get a list of all the email addresses but i need it sorted by each recipients group.

    However when I run the command, Get-NotificationRecipient | where {$_.Name -match 'EIG Level1 Recipients'} | select devices; I can get the email address in the recipient group, but it will only return up to the first four.  I have tried adding foreach to this command, but I had no luck getting all of the emails.
    Thanks in advance for any help!
    Josh
    Tuesday, October 20, 2009 1:49 PM

Answers

  • I think your second attempt is right, it's just not showing all the data due to formatting... If you are using powershell v2, try

    Get-NotificationRecipient | where {$_.Name -match 'EIG Level1 Recipients'} | select -expand devices

    or equivalent in v1

    Get-NotificationRecipient | where {$_.Name -match 'EIG Level1 Recipients'} |foreach { $_.devices }


    Thanks,
    -Lincoln
    • Marked as answer by SuchnSuch Tuesday, October 20, 2009 6:00 PM
    Tuesday, October 20, 2009 5:10 PM

All replies

  • I did a blog post on that a few months ago. Here it is.


    Pete Zerger, MVP-OpsMgr and SCE | http://www.systemcentercentral.com
    Tuesday, October 20, 2009 4:26 PM
  • I think your second attempt is right, it's just not showing all the data due to formatting... If you are using powershell v2, try

    Get-NotificationRecipient | where {$_.Name -match 'EIG Level1 Recipients'} | select -expand devices

    or equivalent in v1

    Get-NotificationRecipient | where {$_.Name -match 'EIG Level1 Recipients'} |foreach { $_.devices }


    Thanks,
    -Lincoln
    • Marked as answer by SuchnSuch Tuesday, October 20, 2009 6:00 PM
    Tuesday, October 20, 2009 5:10 PM
  • Lincoln,
    This worked thanks! I knew it couldn't be something to difficult.

    Pete,
    I saw your blog post and tried it.  It still cut off the email address after the fourth one.

    Thanks for your responses!!
    Josh


    Josh
    Tuesday, October 20, 2009 6:24 PM