Here’s a quick and simple script which can help you to update a target property value of all targets running on a specific host. The script will expect you to enter 3 parameters: host name, property name and property value. Then it will search for the targets running on the given host name, and set the property to the given value:

It’s better to enter the property name in double quotes, because property names can contain spaces (for example “Line of Business”).

The script first checks the number of parameters, then login to OMS (enter your credentials – if you enter username but do not enter password, EMCLI will ask you to enter password when you run the script), gets the targets running on the given host (using EMCLI list command), and then executes set_target_property_value for each target. You may notice I give a non-default separator because some target names can contain colon (:) sign.

3 Responses to “Using EMCLI for Mass Update a Property Value”

  1. Thanks!! .

    Great tip!!


  2. Stuart says:

    This is exactly what I was looking for. However, I am getting an HttpConnectionException whenever I try to login to my OMS. I have searched the web without any luck. Do you know how to fix this issue? I have been able to do the setup step just fine. I get a setup successful when I do the following:

    emcli setup -url=”https://[ip]:[port]/em” -username=”sysman” -trustall -novalidate

    I am just not able to do a login(). Any thoughts?

  3. Thanks Gokhan, this is very helpful. We need not to worry to set properties for multiple targets for a host. This will automatically do the work for us.

    Awesome Tip.



Leave a Reply

Your email address will not be published. Required fields are marked *