A wavefront sensorless adaptive optics technique was combined with a custom-made multiphotonmicroscope to correct for specimen-induced aberrations. A liquid-crystal-on-silicon (LCoS) modulatorwas used to systematically generate Zernike modes during image recording. The performance of the instrument was evaluated in samples providing different nonlinear signals and the benefit of correcting higher order aberrations was always noticeable (in both contrast and resolution). The optimum aberration pattern was stable in time for the samples here involved. For a particular depth location within the sample, the wavefront to be precompensated was independent on the size of the imaged area (up to 360 × 360 μm2). The mode combination optimizing the recorded image depended on the Zernike correction control sequence; however, the final images hardly differed. At deeper locations, a noticeable dominance of spherical aberration was found. The influence of other aberration terms was also compared to the effect of the spherical aberration.