SCOM: Using PowerShell to update SMTP server address in SMTP notification Channels

Written by Tao Yang

I’ve been asked a question on how to bulk update SMTP server addresses in SMTP notification channels using PowerShell.

Here’s the script to run in OpsMgr Command Shell:

$newSMTP = <name of your new SMTP server>
$SMTPChannels = Get-NotificationAction |Where-Object {$_.Name –imatch “smtp”}
Foreach ($item in $SMTPChannels)
{
$item.Endpoint.PrimaryServer.Address = $newSMTP
$item.Endpoint.update()
}

One comment on “SCOM: Using PowerShell to update SMTP server address in SMTP notification Channels

  1. Thanks for this post! saved me a lot of work!
    With a little change it works also for SCOM 2012:

    $newSMTP = “”
    $SMTPChannels = Get-SCOMNotificationChannel |Where {$_.ChannelType –eq “smtp”}
    Foreach ($item in $SMTPChannels)
    {
    $item.Endpoint.PrimaryServer.Address = $newSMTP
    $item.Endpoint.update()
    }

    Greetings
    Marc

Leave a Reply