Diarylethenes are molecular switches, the state of which can efficiently be controlled by illumination with ultraviolet or visible light. To use the change in the molecular properties when switching between the two states for a specific function, direct contact with solid surfaces is advantageous as it provides immobilization. Here we present a study of a diarylethene derivate (T-DAE, 1,2-bis(5-methyl-2-phenylthiazol-4-yl)cyclopent-1-ene) in direct contact with highly ordered graphite as well as with semimetallic Bi(1 1 1) surfaces by x-ray photoelectron spectroscopy, x-ray absorption spectroscopy and simulated spectra based on density functional theory. On both surfaces, the molecule can be switched from its open to its closed form by 325-475 nm broadband or ultraviolet illumination. On the other hand, back isomerization to the ring-open T-DAE was not possible.