We show here how the first law of thermodynamics can be used to generate probability distributions for generalized ensembles. This entails that a change in microscopic level population, if properly constrained, can be associated not only to heat but acquires a more general meaning.