%3CLINGO-SUB%20id%3D%22lingo-sub-365741%22%20slang%3D%22en-US%22%3EGet%20a%20list%20of%20email%20addresses%20used%20in%20SCOM%20notifications%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-365741%22%20slang%3D%22en-US%22%3E%3CP%3E%3CSTRONG%3E%20First%20published%20on%20TECHNET%20on%20Dec%2012%2C%202013%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EI%20haven%E2%80%99t%20blogged%20in%20a%20while%2C%20so%20need%20to%20make%20sure%20this%20thing%20is%20still%20on%20%3A)%3C%2Fimg%3E%26nbsp%3B%20I%E2%80%99ll%20start%20with%20something%20simple%20that%20I%20used%20today.%26nbsp%3B%20One%20of%20my%20customers%20is%20migrating%20from%20SCOM%202007%20to%20SCOM%202012%20and%20needs%20to%20get%20a%20list%20of%20all%20email%20addresses%20that%20are%20used%20in%20Notifications%20(so%20he%20can%20email%20them%20to%20let%20them%20know%20about%20the%20upcoming%20migration).%3C%2FP%3E%0A%3CP%3EBefore%20writing%20something%20I%20did%20a%20quick%20TechNet%20search%20and%20found%20what%20I%20was%20looking%20for%20%3CA%20href%3D%22http%3A%2F%2Fsocial.technet.microsoft.com%2FForums%2Fsystemcenter%2Fen-US%2F73e83614-5e44-433e-9d00-6b10d7942906%2Fscom-get-email-address-by-getnotificationrecipient%3Fforum%3Doperationsmanagergeneral%22%20target%3D%22_blank%22%20rel%3D%22noopener%20noopener%20noreferrer%20noopener%20noreferrer%22%3E%20here%20%3C%2FA%3E%20.%3C%2FP%3E%0A%3CP%3EHere%20are%20PowerShell%20commands%20that%20can%20be%20used%20for%20this%20in%20SCOM%202007%20and%20SCOM%202012%3A%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%20SCOM%202007%3A%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EGet-NotificationRecipient%20%7C%20foreach-object%20%7B%24_.devices%20%7C%20where%20%7B%24_.protocol%20-eq%20%22smtp%22%7D%7D%20%7C%20select%20name%2Caddress%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSTRONG%3E%20SCOM%202012%3A%20%3C%2FSTRONG%3E%3C%2FP%3E%0A%3CP%3EGet-SCOMNotificationSubscriber%20%7C%20foreach-object%20%7B%24_.devices%20%7C%20where%20%7B%24_.protocol%20-eq%20%22smtp%22%7D%7D%20%7C%20select%20name%2Caddress%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EOutput%20(if%20you%20just%20want%20the%20address%20list%2C%20then%20just%20remove%20%E2%80%9Cname%E2%80%9D%20from%20the%20select%20list)%3A%3C%2FP%3E%0A%3CP%3E%3CSPAN%20class%3D%22lia-inline-image-display-wrapper%20lia-image-align-inline%22%20style%3D%22width%3A%20703px%3B%22%3E%3CIMG%20src%3D%22https%3A%2F%2Fgxcuf89792.i.lithium.com%2Ft5%2Fimage%2Fserverpage%2Fimage-id%2F86935i4AC0B1D4A8E66A84%2Fimage-size%2Flarge%3Fv%3D1.0%26amp%3Bpx%3D999%22%20%2F%3E%3C%2FSPAN%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-TEASER%20id%3D%22lingo-teaser-365741%22%20slang%3D%22en-US%22%3E%3CP%3EFirst%20published%20on%20TECHNET%20on%20Dec%2012%2C%202013%20I%20haven%E2%80%99t%20blogged%20in%20a%20while%2C%20so%20need%20to%20make%20sure%20this%20thing%20is%20still%20on%20%3A)%3C%2Fimg%3E%26nbsp%3B%20I%E2%80%99ll%20start%20with%20something%20simple%20that%20I%20used%20today.%3C%2FP%3E%3C%2FLINGO-TEASER%3E%3CLINGO-LABS%20id%3D%22lingo-labs-365741%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EJimmyHarper%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E
Senior Member

First published on TECHNET on Dec 12, 2013

I haven’t blogged in a while, so need to make sure this thing is still on :)  I’ll start with something simple that I used today.  One of my customers is migrating from SCOM 2007 to SCOM 2012 and needs to get a list of all email addresses that are used in Notifications (so he can email them to let them know about the upcoming migration).

Before writing something I did a quick TechNet search and found what I was looking for here .

Here are PowerShell commands that can be used for this in SCOM 2007 and SCOM 2012:

 

SCOM 2007:

Get-NotificationRecipient | foreach-object {$_.devices | where {$_.protocol -eq "smtp"}} | select name,address

 

SCOM 2012:

Get-SCOMNotificationSubscriber | foreach-object {$_.devices | where {$_.protocol -eq "smtp"}} | select name,address

 

Output (if you just want the address list, then just remove “name” from the select list):