We study the optimal management of teams in which agents’ effort decisions are mapped (via a production technology) into the probability of the team’s success. Optimal wage schemes in such context are largely discriminatory, but we show that the extent of the discrimination crucially depends on the existence of moral hazard. More precisely, for teams with a flat structure, the domain of production technologies giving rise to discrimination is broader when agents’ actions are observable and contractible. For teams with a sequential structure, the result reverses and the domain of production technologies giving rise to discrimination is broader when there exists moral hazard. Finally, in more cooperative environments in which agents are allow...