We present near-field optics inverse-scattering procedures, valid within the limits of the Rayleigh hypothesis, for the reconstruction of periodic corrugated surfaces. Firstly, we extend to p polarization a reconstruction procedure valid for s polarization and perfectly conducting samples (Opt. Lett. 18 (1993) 2090). Secondly, we give inverse-scattering solutions that take into account the polarization of the incident field and the geometry of the profile. Finally, we develop a scheme of reconstruction valid for metallic or dielectric samples.