Ying Li at myITforum.com

PowerShell & System Center

PowerShell Script to identify Agent which needs to have "proxying" enabled

Every now and then, I get an alert like this:

Alert: Agent proxying needs to be enabled for a health service to submit discovery data about other computers.

Source: xyzopmp04.related.com

Path: xyzopmp04.related.com

Last modified by: System

Last modified time: 7/21/2008 8:18:46 PM Alert description: Details:Health service ( 9AAFF032-4567-2270-B09A-A34025D969F3 ) should not generate data about this managed object ( EC7903B7-72FC-BFD0-3CA2-473774E60AD4 ).

Alert view link: "http://XYZOPMP01:51908/default.aspx?DisplayMode=Pivot&AlertID={0b2c1100-f167-4691-b271-e209632392bf}"

Notification subscription ID generating this message: {4B6F3971-955E-1491-6D82-5C22F1466FC2

This is common and all we need to do is to identify the agent and then enable proxy.

How we translate something like this -  'EC7903B7-72FC-BFD0-3CA2-473774E60AD4' to the computer name?

1, We can run a SQL query in OperationManagerDB

select * from basemanagedentity where basemanagedentityid =
'EC7903B7-72FC-BFD0-3CA2-473774E60AD4'

2, We could use PowerShell

Save the below script as whatever.ps1

Param([string]$MonitoringObjectID)

Get-MonitoringObject -id $MonitoringObjectID | select name

Then run it from command shell console:

c:\MyWorkSpace\whatever.ps1 EC7903B7-72FC-BFD0-3CA2-473774E60AD4

Either way, you will get the computer name and then you can go to your OpsMgr console to enable proxying for the agent!

Technorati Tags: ,

Comments

No Comments