Finding OpsMgr Management Group Installation Date Using PowerShell

As part of what I’m working on at the moment, I need to find out when the OpsMgr 2012 management group was initially installed using PowerShell (the installation time of the first management server). To do so, I can either use the OpsMgr SDK or the OperationsManager PowerShell module. I’ve developed below scripts to run locally on a management server: Using SDK: [sourcecode language=”PowerShell”] $MgmtServer = $Env:COMPUTERNAME #Connect to SCOM management group [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager.Common") | Out-Null [System.Reflection.Assembly]::LoadWithPartialName("Microsoft.EnterpriseManagement.OperationsManager") | Out-Null $MGConnSetting = New-Object Microsoft.EnterpriseManagement.ManagementGroupConnectionSettings($MgmtServer) $MG = New-Object Microsoft.EnterpriseManagement.ManagementGroup($MGConnSetting) $MG.GetManagementGroupMonitoringObject() [/sourcecode] TimeAdded property indicates the MG initial installation date. Using OperationsManager PowerShell module:

Continue reading
%d bloggers like this: