@py , From your description, I know the agents connect to GW2 are all greyed out. And the GW2 server is still healthy. If there's any misunderstanding, please let us know.
For our issue, we can go to the affected agent side and check HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft Operations Manager\3.0\Agent Management Groups\<SCOM management group>\Parent Health Services\, Make sure Authentication name and network name are the FQDN of GW2 server.
Our issue is resolved. Here is a summary for it:
Cause:
=========
The servers in GW2 domain have been assigned a Management server rather than the GW server when the AD assignment is switched in a script
Resolution:
============
Uncheck the AD assignment and change the Management server to Gateway name.
Hope it can help.
If the response is helpful, please click "Accept Answer" and upvote it.
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.