Photosynthetic microorganisms can export electrons outside their cells, a phenomenon called exoelectrogenesis, which can be harnessed for solar energy conversion. However, the route electrons take from thylakoid membranes to the cell exterior is not understood. Electrochemistry is a powerful analytical technique for studying electron transfer pathways. Here, we show how photoelectrochemistry can be used to compare electron flux from cyanobacterial cells of different growth stages, species and with the outer layers systematically removed. We show that the periplasmic space contributes significantly to the photocurrent profile complexity of whole cells, indicating that it gates electron transfer in exoelectrogenesis. We found that although components of the type IV pili machinery do not have a role in exoelectrogenesis, they contribute significantly to cell-electrode adherence. This study establishes that analytical photoelectrochemistry and molecular microbiology provide a powerful combination to study exoelectrogenesis, enabling future studies to answer biological questions and advance solar energy conversion applications.