In this talk results from CMS measurements of quarkonia in pPb and PbPb collisions will be presented. CMS has excellent muon detection capabilities which has resulted in a wealth of results on quarkonia (both charmonia as well as bottomonia) measured in dimuon channel. The good mass resolution in dimuon channels allows precise measurement all three Upsilon states and their relative yields in pp, pPb as well as PbPb systems which have ability to quantify the properties of strongly interacting matter. In the charmonia sector, measurements of relative yields of J/psi, psi(2S) are equally useful. In addition excellent vertex capability of CMS enables measurement of B mesons via its decay to J/psi which are useful tool to verify energy loss mechanisms of heavy quarks in medium. A detailed overview of all these measurements will be given. How the absolute and relative yields of different charmonia and bottomonia states are modified in heavy ion collisions will be discussed. The results will be compared with other experiments at RHIC and LHC and with theory wherever available. This writeup summarizes CMS results on quarkonia measurements in pp, pPb and PbPb collisions at LHC. CMS has excellent muon detection capabilities which has resulted in a wealth of results on quarkonia (both charmonia as well as bottomonia) measured in dimuon channel. The good mass resolution in dimuon channels allows precise measurement of all three ϒ states and their relative yields in pp, pPb as well as PbPb systems, which have ability to quantify the properties of strongly interacting matter. In the charmonia sector, measurements of relative yields of J/ψ, ψ(2S) are equally useful. In addition excellent vertex capability of CMS enables measurement of B mesons via its decay to J/ψ which are useful tool to verify energy loss mechanisms of heavy quarks in medium. An overview of these measurements is given. How these measurements compare with other experiments at RHIC and LHC and have improved the understanding of heavy ion collisions has been discussed.