We consider a contribution of microlensing to the X-ray variability of high-redshifted QSOs . Cosmologically distributed gravitational microlenses could be localized in galaxies ( or even in bulge or halo of gravitational macrolenses ) or could be distributed in a uniform way . We have analyzed both cases of such distributions . We found that the optical depth for gravitational microlensing caused by cosmologically distributed deflectors could be significant and could reach 10 ^ { -2 } -0.1 at z \sim 2 . This means that cosmologically distributed deflectors may contribute significantlly to the X-ray variability of high-redshifted QSOs ( z > 2 ) . Considering that the upper limit of the optical depth ( \tau \sim 0.1 ) corresponds to the case where dark matter forms cosmologically distributed deflectors , observations of the X-ray variations of unlensed QSOs can be used for the estimation of the dark matter fraction of microlenses .