Hi,
In case you are using 2007 R2, you can just navigate to the SCOM administration portal and check the management server name.
From there, navigate to the agent managed view and check the number of grey agents reporting to the deleted Management Server and change the reporting management server name for all of them. During changing the management server name, make sure that all
of your agents are remotely manageable. If not so, please run the below query on your database to make all the agents remotely manageable and then change the management server then. The account which is running the query must be having write access on the
Operations Manager DB.
UPDATE MT_HealthService
SET IsManuallyInstalled=0
WHERE IsManuallyInstalled=1
Now, as a next step, go the server from where you deleted the management server role and install the Management Server Role through the SCOM installation kit. It hardly takes 5-10 mins. Make sure that while installing the management server role, provide
the correct Management Group name [case sensitive considered].
Now, navigate to the SCOM Administration pane and check the health status of the Management server, if healthy now. Then reassign the same management server to earlier agents.
Done!!!