@Kam Wai Chan , To update SMTP server address in SMTP notification Channels, maybe we can try the following script:
Import-Module OperationsManager
$newSMTP = "new SMTP server name";
$SMTPChannels = Get-SCOMNotificationChannel | Where-Object {$_.displayName -eq "the Notification channel name"}
Foreach ($item in $SMTPChannels)
{
$item.Endpoint.PrimaryServer.Address = $newSMTP
$item.Endpoint.update()
}
Here are some other scripts for the reference:
Cleanup the subscribers:
http://bakerhughes-andreprins.blogspot.com/2017/10/scom-20122016-automated-subscribers.html
Note: Non-Microsoft link, just for the reference:
Export all subscriptions:
https://github.com/Sameer-Mhaisekar/scripts/blob/main/export-scomsubscriptions.txt
To Remove all the subscription, maybe we can try the following commands:
Import-Module OperationsManager
Get-SCOMNotificationSubscription | where {$_.displayname -like $subscription} | Remove-SCOMNotificationSubscription
https://learn.microsoft.com/en-us/powershell/module/operationsmanager/remove-scomnotificationsubscription?view=systemcenter-ps-2016
To add a notification subscription, we can choose "Add-SCOMNotificationSubscription" command, we can see more details in the following link:
https://learn.microsoft.com/en-us/powershell/module/operationsmanager/add-scomnotificationsubscription?view=systemcenter-ps-2016
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.