While using System Center Operations Manager 2007 R2 you may be unable to install some agents. When pushing the agent you may get the following error:
One or more computers you are trying to manage are already in the process of being managed. Please resolve these issues via the Pending Management view in Administration, prior to attempting to manage them again.
This can occur if there is an old entry present in the AgentPendingAction table in the database. To resolve this issue execute the following steps:
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.
3. 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.
Hope this helps,
Atanu Dey | System Center Support Engineer