Confined molecules: Thermodynamic properties from simulations