In this paper we study the effect of applying a magnetic field on an elliptical microcavity pillar with quantum dots embedded, in the presence of external laser excitation. To obtain the system dynamics we use the matrix density formalism, taking into account realistic parameters and including losses. Our results show that it is possible to use the magnetic field strength to control the polarization of the photons inside the cavity, making our system behave like a photon polarization switch. We also report the best set of parameters where this is possible. Our results also indicate that we can use the polarization of the cavity photons to look into the fine structure of the energy levels of quantum dots.