An electrical machine (1) with a machine housing (5) receiving an electrically excited rotor (2) and a stator (10) of the electrical machine (1) and with an electronics unit (18) fastened to the machine housing (5) and electrically connected to an exciter winding (3) of the rotor (2) via at least one sliding contact (11, 12) consisting of at least one slip ring (13, 14) assigned to the rotor (2) and at least one brush (15, 16) assigned to the electronics unit (18), the brush (15, 16) being arranged displaceably in a brush holder (20). In this case it is provided that the brush holder (20) is fastened exchangeably in a guiding recess (27) of the electronics unit (18).