4

I have executed both the commands in powershell

  1. Get-SCOMMonitoringObject
  2. Get-SCOMClassInstance

But I'm getting same results for both the command output.

Is there any significant difference between these two commands?

Environment: SCOM 2012R2 Server

  • Try running the two with the `-Verbose` flag and piping them through `Get-Member` to see if they're actually identical. It's likely they're returning different objects and the types file is displaying them the same, or they're being retrieved differently. – Maximilian Burszley May 14 '18 at 14:56
  • I don't script system center. This my 2-cents. `Get-MonitoringObject` is a commandlet distributed with Operations Manager 2007 R2. `Get-SCOMClassInstance` is a part of the `OperationsManager` module, which was distributed with System Center 2012 R2. I believe they both pull back monitoring objects. I'd go with the newer module unless you have a specific reason not to. – Adam May 14 '18 at 17:25

1 Answers1

6

In SCOM 2007, Get-SCOMMonitoringObject is the only command, but it was replaced with Get-SCOMClassInstance command in SCOM 2012. SCOM 2012 doesn't have Get-SCOMMonitoringObject command, but features an alias for it:

Get-Command Get-SCOMMonitoringObject | fl *

ResolvedCommandName : Get-SCOMClassInstance
DisplayName         : Get-SCOMMonitoringObject
ReferencedCommand   : Get-SCOMClassInstance
ResolvedCommand     : Get-SCOMClassInstance
Definition          : Get-SCOMClassInstance
Name                : Get-SCOMMonitoringObject
CommandType         : Alias
Max
  • 751
  • 6
  • 10