- The optical switching of molecular ensembles in a dissipative environment is a subject of various fields of chemical physics and physical chemistry. Here we try to switch arrays of molecules from a stable collective ground state to a state in which all molecules have been transferred to another stable higher-energy configuration. In our model switching proceeds through electronically excited intermediates which are coherently coupled to each other through dipolar interactions, and which decay incoherently within a finite lifetime by coupling to a dissipative environment. The model is quite general, but parameters are chosen to roughly resemble the all-trans -> all-cis isomerization of an array of azobenzene molecules on a surface. Using analytical and optimal control pulses and the concept of "laser distillation," we demonstrate that for various aggregates (dimers up to hexamers), controlled and complete switching should be possible.