# Is the formula of temperature $\frac{1}{T}= \left(\frac{\partial S}{\partial U}\right)_{V,N}$ applicable to all type of ensembles?

I have seen multiple posts on this page that explained the statistical definition of Temperature as the derivative of the Entropy to the energy:

$$\frac{1}{T}\equiv \left(\frac{\partial S}{\partial U}\right)_{V, N}$$ Where $S$ has always been the Boltzmann Entropy,

$$S = - k_B \ln \Omega(U, V, N)$$

My Question is: Does this Definition also apply to other Ensembles than the micro-canonical Ensemble? For any other Ensemble, can I also calculate $\dfrac{\partial S}{\partial \langle U\rangle }$ where $\langle U\rangle$ is supposed to be the averaged Energy and $S = -k_B \langle \ln(\rho)\rangle$ is not any-more the Boltzmann entropy, but instead the Gibbs - Entropy, with $\rho$ being the probability distribution of the system?

I know that there are ensembles in which temperature is given externally and then defines the state of the system, like the canonical ensembles. But you can still assume for a given set of equilibrium states, that the temperature "changes" with the change of average Energy $\langle U\rangle$, and thus my question is up also for those cases.