GetSiteGate returns the QueueManager.Identifier of an MSMQ Site Gate for a given QueueManager identified by the MachineID parameter. If no MSMQ Site Gate is found within the Site to which the QueueManager belongs, this method returns Nothing.

 GetSiteGate(MachineID of type GUID)
 ;MachineID – QueueManager.Identifier that identifies the machine
 INIT SourceMachine of type QueueManager
 INIT SiteGate of type GUID
 INIT SiteTemp of type Site
 INIT ArraySite of type vector of Site
 SET SourceMachine to result of CALL GetQueueManager(MachineID)
 IF SourceMachine = Nothing THEN
     RETURN with Nothing
 SET SiteGate to Nothing
 SET ArraySite to result of CALL GetDirectoryData("Site", Nothing)
 IF ArraySite = Nothing THEN
     RETURN with SiteGate
 FOREACH SiteTemp FROM ArraySite DO
    IF SiteTemp.Identifier in
  SourceMachine.SiteIdentifierList THEN
         SET SiteGate to one of SiteTemp.SiteGateCollection
 RETURN with SiteGate