Operations Manager
SCOM 2016 migration – Transfer alert Ticket ID
Quick publish:
We are migrating a large SCOM environment to 2016 and the current 2012 environment have an integration with our ticketing system. As we want the migration as smooth as possible, updating the co-existing alerts with the already connected ticket ID seemed like a good idea.
All alerts with an assigned ticket that aren’t closed have a custom resolution state. Using Powershell I grabbed all alerts from SCOM 2012 and updated the same alerts in our 2016 environment.
Import-Module OperationsManager
#Connect to old SCOM environment
$OldEnv = New-SCOMManagementGroupConnection OldScomServer
#Get all alerts with custom resolution state, indicating a ticket is created
$Alerts = get-scomalert | where {$_.ResolutionState -eq 3}
#Connect to the new SCOM Environment.
$NewEnv = New-SCOMManagementGroupConnection NewSCOMServer
#Loop through the alert and set resolution state, ticket and custom field in the new environment
foreach ($Alert in $Alerts)
{
Get-ScomAlert | where {$_.Name -eq $Alert.Name -and $_.MonitoringObjectPath -eq $Alert.MonitoringObjectPath -and $_.ResolutionState -eq 0} | Set-SCOMAlert -ResolutionState 3 -CustomField4 "TEXT" -TicketID $Alert.TicketId
}
#list updated alerts
Get-SCOMAlert -ResolutionState 3 | select Name, TicketID
As you see, we have a string in custom field 4, you can just remove this and change your resolution state to fit your environment.



