Skip to content
adatum
  • Home
  •  About adatum
  •  Learn Azure Bicep
  •  SCOM Web API
Lecture speaking Community

Speaking at Experts Live Berlin

  • 16/08/201707/01/2025
  • by Martin Ehrnst

For the first time i will speak publicy outside Norway. I am travelling to Experts Live in Berlin.

I was lucky to be invited by SquaredUp to their SCOM community (and famous whisky Tasting) session. I’ll have a small contribution on how you can automate and integrate your operations manager environment with your modern application stack.
If you find SCOM interesting, come by and see a live demo on the SCOM Web API, Powershell management pack and other great community contributions.

More about Experts Live and a session list

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Operations Manager

SCOM 2016 migration – Transfer alert Ticket ID

  • 12/06/201707/01/2025
  • by Martin Ehrnst

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.

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit
Automation

Update: SCOM web API

  • 02/06/201707/01/2025
  • by Martin Ehrnst

Big updates:

I have made a lot of changes to the SCOM web API. As you can see from the picture above. Maintenance scheduling is added, which means you can create a new maintenance schedule in SCOM 2016. To the computer endpoints I have added the a possibility to get detailed information. This will list all related object to the server. Logical disks, network cards etc.

These are the API endpoints available at the moment:

Agents

Route Description
[GET] API/Agents Gets all agents
[GET] API/Agents/{id} Get a single agent

Alerts

Route Description
[GET] API/Alerts Gets all open alerts
[GET] API/Alert/{id} Get a single alert
[PUT] API/Alert Update the specified alert with resolution state, TicketId
[GET] API/Alert/{ComputerName} Get all alert from specific computer, use IncClosed=true to include open and closed alerts

Computer

Route Description
[GET] API/Computer/Windows Get all windows computers wit basic properties
[GET] API/Computer/Windows/{ComputerName} Get A single windows computers with basic properties
[GET] API/Computer/Windows/{ComputerName}/Detailed Get A single windows computers with hosted child objects
—— ——
[GET] API/Computer/Linux Get all Linux computers wit basic properties
[GET] API/Computer/Linux/{ComputerName} Get A single Linux computer with basic properties
[GET] API/Computer/Linux/{ComputerName}/Detailed Get A single Linux computers with hosted child objects

Maintenance

Route Description
[POST] API/ComputerMaintenance Put the specific computer object and all child in maintenance mode
[POST] API/ObjectMaintenance Put the specific monitoring object and all child in maintenance mode
[POST] API/MaintenanceSchedule Create a new maintenance schedule. SCOM 2016 ONLY

Object

Route Description
[GET] API/MonitoringObject/{id} Get a monitoring object and all child object

 

Examples

Create a new maintenance schedule by sending a post to /API/MaintenanceSchedule with a body including object id, start date and end date in UTC, optionally a comment.

#CREATE A MAINTENANCE SCHEDULE WITH TWO OBJECTS. Time in UTC

$body = @"
{
  "scheduleName": "new maintenance schedule",
  "id": "a43a5b09-5c32-8624-1427-73b8e1f05248",
  "StartTime": "2017-05-30T13:53:33.550Z",
  "EndTime": "2017-05-30T14:53:33.550Z",
  "comment": "TicketID"
}
"@


Invoke-RestMethod -Uri 'http://localhost:64049/API/MaintenanceSchedule' -Method Post -Body $body -UseDefaultCredentials -ContentType 'Application/json'

Get details/related object from a computer:

Invoke-RestMethod -Uri 'https://host/API/Computer/windows/computer.fqdn/Detailed' -UseDefaultCredentials

Which will return something like this. Notice the relatedObjectsCount and relatedObjects

Share this:

  • Click to share on LinkedIn (Opens in new window) LinkedIn
  • Click to share on X (Opens in new window) X
  • Click to share on Reddit (Opens in new window) Reddit

Posts pagination

1 … 3 4 5 6 7 … 13

Popular blog posts

  • Webinar: Multi-tenant resource management at scale with Azure Lighthouse
  • Azure Application registrations, Enterprise Apps, and managed identities
  • Azure Monitor Managed Prometheus
  • Azure token from a custom app registration
  • OpsMgr & External Services PT2

Categories

Automation Azure Azure Active Directory Azure Bicep Azure DevOps Azure Functions Azure Lighthouse Azure Logic Apps Azure Monitor Azure Policy Community Conferences CSP Monitoring DevOps GitHub Guest blogs Infrastructure As Code Kubernetes Microsoft CSP MPAuthoring OMS Operations Manager Podcast Powershell Uncategorised Windows Admin Center Windows Server

Follow Martin Ehrnst

  • X
  • LinkedIn

RSS feed RSS - Posts

RSS feed RSS - Comments

Microsoft Azure MVP

Martin Ehrnst Microsoft Azure MVP
Adatum.no use cookies to ensure that we give you the best experience on our website. If you continue to use this site we will assume that you are happy with it. Cookie Policy
Theme by Colorlib Powered by WordPress