Event ID: 20000 on Management server
Here is the cause and resolution for Event: 20000 in MS/GW servers and same solution applicable for event: 20070/20071 which are compelling at agent side.
Open event 20000 on MS server and get the agent name from event which is trying to communicate to MS.
Open OpsMgr powershell on respective MS and type “Get-SCOMPendingManagement”. This command show the agent names which are trying install/upgrade SCOM agent using SDK.
If the command prints any agents, try to find agent name which your trying onboard to SCOM, if you find the server name then reject the process using this command “get-scompendingmanagement | where {$_.agentpendingactiontype -like "AgentName*"}| Deny-SCOMPendingManagement ”
If the command “Get-SCOMPendingManagement” gives 0 output, Login in to the server which is showing in event: 20000 and search for 20070 and 20071. If you find the event execute below SQL query against respective MG OpsDB.
Select * from [dbo].[MTV_Computer]
Where DisplayName like '%Server name'
Out from result copy “Basedmangeentity” GUID ID and use below query with result GUID ID.
Select * from dbo.[BasemanagedEntity]
where BaseManagedEntityId = '526E094D-AE0B-60DE-4110-2FCF62DCF715'
Execute both queries same time on OpsDB and look for both SQL queries are resulting same display name of agent which your trying to remediate.
If the display Name and GUID of server are same on both tables use below query and set “IS Delete=1”
UPDATE dbo.[BasemanagedEntity] SET IsDeleted = 1 where BaseManagedEntityId = '526E094D-AE0B-60DE-4110-2FCF62DCF715'
After the query is executed run the below powershell CMDLET.
Remove-SCOMDisabledClassInstance
CMDLET take 20-30 mins based on the MG load.
Note: Incase if the agent is showing in SCOM console and still unable to communicate with MS, please don’t follow the above procedure and never use\execute update query.