OpsMgr 2012: Powershell Cmdlet Get-MonitoringPropertyValue removed – but how to get these values now?

Some OpsManager 2007 cmdlets have been removed in OpsManager 2012. But what if you used those in your scripts?
You will need to replace them.

One example is the cmdlet get-monitoringpropertyvalue. Where you can read values OpsManager has stored in a property.

Here is a script that shows how this value can be read within SCOM 2012:

$computername = “servername.abc.de”
$class = get-scomclass -Displayname “Classname”
$agent = get-scomclassinstance -class $class | where {$_.Displayname -like $computername}
$prop = $agent.getmonitoringproperties() | where {$_.Displayname -like ‘Propertyname’}
$agent.getmonitoringpropertyvalue($prop)

Advertisements
Post a comment or leave a trackback: Trackback URL.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: