A refrigerating and air-conditioning apparatus comprising: a refrigeration cycle that makes a refrigerant circulate therethrough by connecting a compressor, a heat-source-side heat exchanger, at least one expansion valve (16a-16d), and at least one intermediate heat exchanger (15a, 15b); and a heat-medium circuit that makes a heat medium circulate therethrough by connecting at least one pump (21a, 21b), a plurality of use-side heat exchangers (26a-26d), and the at least one intermediate heat exchanger (15a, 15b), wherein the at least one intermediate heat exchanger (15a, 15b) and the at least one pump (21a, 21b) are accommodated in a relay unit, and wherein the plurality of use-side heat exchangers (26a-26d) are accommodated in respective indoor units (2a-2d), wherein each indoor unit (2a-2d) includes an indoor-unit controller (62a-62d) that performs on-off control for operation performed by the use-side heat exchanger for exchanging heat between the heat medium and a thermal load, and in that the relay unit includes a plurality of branch ports (6a-6d) that are connected to the plurality of use-side heat exchangers (26a-26d) and make the heat medium circulate to the use-side heat exchangers (26a-26d), outlet temperature sensors (34a-34d) that are provided for the respective branch ports (6a-6d) and each detect an outlet temperature of the heat medium flowing out of the branch port (6a-6d) to the corresponding use-side heat exchanger (26a-26d), inlet temperature sensors (33a-33d) that are provided for the respective branch ports (6a-6d) and each detect an inlet temperature of the heat medium flowing into the branch port (6a-6d) from the corresponding use-side heat exchanger (26a-26d), and a relay-unit controller that is connected to the indoor-unit controllers (62a-62d) by a transmission line (71a-71c) and controls operation of each indoor-unit (2a-2d) by transmitting an operation command or a stop command thereto via the transmission line (71a-71c), and wherein the relay-unit controller makes the indoor units (2a-2d) operate on a one-by-one basis and identifies which of the indoor units (2a-2d) is connected to the respective branch port (6a-6d) on the basis of a difference between the inlet temperature and the outlet temperature at the respective branch port (6a-6d). a refrigeration cycle that makes a refrigerant circulate therethrough by connecting a compressor, a heat-source-side heat exchanger, at least one expansion valve (16a-16d), and at least one intermediate heat exchanger (15a, 15b); and a heat-medium circuit that makes a heat medium circulate therethrough by connecting at least one pump (21a, 21b), a plurality of use-side heat exchangers (26a-26d), and the at least one intermediate heat exchanger (15a, 15b), wherein the at least one intermediate heat exchanger (15a, 15b) and the at least one pump (21a, 21b) are accommodated in a relay unit, and wherein the plurality of use-side heat exchangers (26a-26d) are accommodated in respective indoor units (2a-2d), wherein each indoor unit (2a-2d) includes an indoor-unit controller (62a-62d) that performs on-off control for operation performed by the use-side heat exchanger for exchanging heat between the heat medium and a thermal load, and in that the relay unit includes a plurality of branch ports (6a-6d) that are connected to the plurality of use-side heat exchangers (26a-26d) and make the heat medium circulate to the use-side heat exchangers (26a-26d), outlet temperature sensors (34a-34d) that are provided for the respective branch ports (6a-6d) and each detect an outlet temperature of the heat medium flowing out of the branch port (6a-6d) to the corresponding use-side heat exchanger (26a-26d), inlet temperature sensors (33a-33d) that are provided for the respective branch ports (6a-6d) and each detect an inlet temperature of the heat medium flowing into the branch port (6a-6d) from the corresponding use-side heat exchanger (26a-26d), and a relay-unit controller that is connected to the indoor-unit controllers (62a-62d) by a transmission line (71a-71c) and controls operation of each indoor-unit (2a-2d) by transmitting an operation command or a stop command thereto via the transmission line (71a-71c), and wherein the relay-unit controller makes the indoor units (2a-2d) operate on a one-by-one basis and identifies which of the indoor units (2a-2d) is connected to the respective branch port (6a-6d) on the basis of a difference between the inlet temperature and the outlet temperature at the respective branch port (6a-6d).