Molecular switches represent a fascinating class of functional molecules, whose properties can be reversibly changed between different molecular states by excitation with light or other external stimuli. Using surface science concepts like self assembly to align such molecules in a well-defined geometry at solid surfaces, new functional properties may arise, which are relevant for different fields like, e.g., molecular electronics, sensing or biocompatible interfaces. For a microscopic understanding of molecular switching at surfaces, it is essential to obtain detailed knowledge on the underlying elementary processes, for instance the excitation mechanism in photoinduced switching. Here we present a case study of a specifically designed azobenzene derivative on a metal surface, namely tetra- tert-butyl-azobenzene (TBA) adsorbed on Au(1 1 1), which is so far one of the best studied system for which reversible conformational changes have been demonstrated. TBA/Au(1 1 1) can thus be viewed as model system in order to gain deeper insights into molecular switching processes at metal surfaces. We have studied the photoinduced and thermally activated reversible switching of TBA in direct contact with a Au(1 1 1) surface using two-photon photoemission (2PPE) and high-resolution electron energy loss spectroscopy (HREELS). The trans/cis-isomerization of TBA is accompanied by reversible changes in the geometrical and electronic structure of the molecules, allowing to gain mechanistic and quantitative insight into the switching process. In particular, the cross sections for the photoisomerization, the ratio between the cis- and trans-TBA in the photostationary state, and the activation energy for the thermally induced cis → trans reaction have been determined and are found to be strongly reduced compared to the corresponding quantities in the liquid phase. Furthermore, the mechanism of optical excitation and molecular switching of TBA on Au(1 1 1) has been identified to arise from a substrate-mediated charge transfer process, whereby photogenerated hot holes in the Au d-band lead to transient positive ion formation, which may subsequently result in the conformational switching of adsorbed TBA. This substrate mediated excitation process for surface-bound TBA is thus completely different from the well-known direct (intramolecular) excitation mechanism operative in the photoisomerization of free molecules. These results demonstrate the feasibility of molecular switching at metal surfaces, but also indicate that the switching properties of the surface-bound species are strongly modified by the interaction with a metal substrate. Therefore, molecular switches at surfaces open the perspective to design and optimize novel properties of functional surfaces, which can be controlled by external stimuli.