次の方法で共有


Check if new Management Packs have been received using PowerShell

Today I deployed some new Management Pack in my OM2012 demo environment, and to check if the Management Packs got deployed I checked the Operations Manager Eventlog for eventid 1201.

And because I do this every time when I deploy new Management Packs I created a PowerShell script to check for these events. This is why we invented PowerShell Smile

 

I wanted to know which Management Packs where deployed since the last hour. No need to retrieve all deployed Management Packs.

$regex = [regex]'"(.*?)"'

#Custom formatting $format = @{Label="MPName-Version";Expression={$regex.Matches($_.Message)}}

get-eventlog -LogName "Operations Manager" -after (get-date).addhours(-1) |     Where-Object {$_.Eventid -eq 1201} |     Format-Table TimeGenerated, EventId, $format -AutoSize

 

You can even add the –computername switch to retrieve remote eventids if you want.

image 

Tweet