The aim of this article is to investigate the presence of a conformal vector \(\xi \) with conformal factor \(\rho \) on a compact Riemannian manifold M with or without boundary \(\partial M\) . We firstly prove that a compact Riemannian manifold \((M^n, g),n \ge 3,\) with constant scalar curvature, with boundary \(\partial M\) totally geodesic, in such way that the traceless Ricci curvature is zero in the direction of \(\nabla \rho ,\) is isometric to a standard hemisphere. In the 4-dimensional case, under the condition \(\displaystyle \int _M|\mathring{Ric}|^2\langle \xi ,\nabla \rho \rangle \,dM\le 0\) , we show that, either M is isometric to a standard sphere, or M is isometric to a standard hemisphere. Finally, we give a partial answer to the cosmic no-hair conjecture.