Search code examples
windows-server-2012scomsystem-centermanagement-pack

OpsMgr 2012 agent installation fails with "One or more computers you are trying to manage are already in the process of being managed"


I am authoring a management pack in XML and using the authoring console in System Center. For testing the MP I created, I need to install agents on machines that have my distributed app running.

SCOM Operations Manager 2012 agent installation fails with

One or more computers you are trying to manage are already in the process of being managed

I know this issue should be resolved from the database - do you know what SQL queries I should run to remove the machines I am trying to install agents on from the pending actions table?


Solution

  • Procedure here

    1. Back up the database!

    2. Execute the following query:

    SELECT AgentPendingActionId
    FROM AgentPendingAction
    WHERE AgentName like 'computername'
    

    This should output any single entry that points to the same agent.

    1. Run the command below remove the agent from pending Management:
    DECLARE @ActionId uniqueidentifier
    SET @ActionId =
    (
       SELECT AgentPendingActionId
       FROM AgentPendingAction
       WHERE AgentName like 'computername'
    )
    EXEC p_AgentPendingActionDeleteByIdList @AgentPendingActionIdList = @ActionId 
    

    Once you complete this, you should be able to re-run agent discovery and successfully install the agent.