Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Microsoft System Center Powershell Essentials

You're reading from   Microsoft System Center Powershell Essentials Efficiently administer, automate, and manage System Center environments using Windows PowerShell

Arrow left icon
Product type Paperback
Published in Apr 2015
Publisher Packt
ISBN-13 9781784397142
Length 140 pages
Edition 1st Edition
Arrow right icon
Toc

Table of Contents (10) Chapters Close

Preface 1. Setting up the Environment to Use PowerShell 2. Administration of Configuration Manager through PowerShell FREE CHAPTER 3. Scenario-based Scripting for SCCM Administration 4. Administration of Operations Manager through PowerShell 5. Scenario-based Scripting for SCOM Administration 6. Administration of Service Manager through PowerShell 7. Scenario-based Scripting for SCSM Administration 8. Best Practices Index

Finding management pack details for a particular alert


This is one of the common requirements that both SCOM administrators and management pack developers will be interested in: the details of the management pack responsible for a particular alert.

Here, we are trying to get the details of the alert that has File Transfer Error in the name of the alert. We can use any wild characters of our choice to get the details of an alert for the management pack mapping we are interested in. Also, the code will fetch only the first alert with File Transfer Error in its name:

$alertName = "File Transfer Error"
$allAlerts = Get-SCOMAlert
$alert = $allAlerts | Where {$_.Name -like $alertName} | Select -First 1
If ($alert.IsMonitorAlert -eq "True") 
{
  Write-Host "This is a monitor-generated alert"
  $monitor = Get-SCOMMonitor -ID $alert.MonitoringRuleID
  $mp = $monitor.GetManagementPack()
  $infoObj = New-Object PSObject -Property @{Enabled = $monitor.Enabled; DisplayName = $monitor.DisplayName; ManagementPack...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime