Sometimes for a variety of reasons it becomes necessary to try and figure out which gateways are paired to which management servers and unfortunately this is a configuration that can often slip under the radar when documenting a management group.
Luckily there is a simply way to figure this out without having to log on to each server and trawl through the registry.

Get-SCOMGatewayManagementServer | where {$_.Name –eq “< GATEWAY SERVER >”} | Get-SCOMParentManagementServer
Note: this command has changed slightly from past versions of SCOM