Back up the database!
Execute the following query:
SELECT AgentPendingActionId
FROM AgentPendingAction
WHERE AgentName like 'computername'
This should output any single entry that points to the same agent.
- 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.