Johann Maximilian's father Georg Siegmund von Lamberg (1565–1632) was Empress Anna's Obersthofmeister and had a total of fourteen children from three marriages.
His third wife and mother of Johann Maximilian was Giovanna della Scala (Johanna von der Leiter, 1574–1649), widow of Sigismund of Dietrichstein.
He was therefore the half-brother of Maximilian, Prince of Dietrichstein, and this close connection with a leading noble family helped the Lambergs to build a prestigious position at court in the 17th century.
While Sweden was then trying to reverse the outcome of the war by invading Moravia and later Prague, Lamberg completed a series of difficult negotiations with Swedish Chancellor Axel Oxenstierna.
After returning to Vienna, he became the highest chamberlain of Archduke Leopold in 1650, and the following year he was appointed Oberhofmeister to the future Empress, Eleonora Gonzaga von Mantua-Nevers, the third wife of Emperor Ferdinand III.
He is described in the literature as an honest and educated nobleman who was not inclined to scheming and, thanks to the long-term trust of Emperor Leopold I, he was one of the important figures of the Habsburg monarchy in the second half of the 17th century.