Differential cross sections of nucleons excited in photonuclear reactions in medium and heavy nuclei are studied by considering all relevant reaction mechanisms leading to the excitation of protons or neutrons. We take advantage of previous microscopic studies for the absorption and scattering of photons and photoproduced pions, and implement a simulation code in order to take into account the propagation of the nucleons as well as their collisions with other nucleons in the nuclear medium, which generate secondary excited nucleons. Comparison with experimental data is done. Cross sections for nucleon emission in coincidence with one pion are also calculated, and some coincidence observables are discussed.