Book Image

Microsoft System Center Powershell Essentials

Book Image

Microsoft System Center Powershell Essentials

Overview of this book

Table of Contents (15 chapters)
Microsoft System Center PowerShell Essentials
Credits
About the Authors
About the Reviewers
www.PacktPub.com
Preface
4
Administration of Operations Manager through PowerShell
Index

Listing all updated management packs


The code here will get the list of all management packs updated in the last 24 hours. We can change this interval by changing the hours (24 in this example) in the following code to get the list of the management packs updated in the custom intervals:

$MyDate = (Get-Date).AddHours(-24)
$AllMPs = Get-SCOMManagementPack
$ModifiedMPs= $AllMPs | Where {$_.LastModified -gt $MyDate} 
  | Select-Object Name, LastModified | Sort LastModified 
$ModifiedMPs | Out-File –FilePath "C:\SCOM\MP\updated.txt"