New SCOM Gateway not connecting to its management server and no health state

This is the second time I see this happening in a few weeks, so time to post it out again.
What happened is that we approved a new SCOM gateway server and installed the gateway. All good and without issues. However we did not see any health state change for this gateway and no state on the Windows component and so on for this machine. No state at all actually. Additional info with this is that the gateway was in the same domain and no certificates were used (or needed). The SCOM version was 2007 R2 CU4.
First of all went to the gateway and checked the event logs. There were a lot of the following error notifications that the management server on the other side refuses the connection. First did a restart of the system center management service in order to see a clean start of the service and what happens. Same issue.

Last time I could not really find out what had happened that we saw this behavior, but I did find the workaround.
And here it is:

  • Stop the System Center Management service on the gateway machine.
  • Open the registry editor and go to the following path (using your own managementgroupID of course):
    HKLMSOFTWAREMicrosoftMicrosoft Operations Manager3.0Server Management GroupsMymgmtgroupIDParent Health Services
  • Change the values of AuthentiocationName and NetworkName from the current management server to another management server.
  • Restart the System Center Management Service on the gateway machine
  • Check the operations manager eventlog on the gateway server if connection is established.
  • Let this run for some time and the state will appear in SCOM and it will be monitoring

If you like you can use the same steps to change the entries back to the management server you wanted it to talk to. In my case this worked without complaining and it kept monitoring and communicating through the management server that originally refused connection.
This worked for me two times now. Hope it helps you too if this happens to you. I know that the first time I have been looking for quite some time and the second time when remembering the workaround it was just minutes.
Good luck!
Bob Cornelissen