of the House of Ascania through her mother, Princess Anna Marie of Anhalt-Zerbst, who was the daughter of Joachim Ernst, Duke of Anhalt; through her father, Barbara Agnes descended from dukes of Silesia and from Władysław II the Exile) Hans Ulrich received all rights of a Silesian sovereign and was awarded the title Semperfrei by the Holy Roman emperor. As an imperial general, he served under Wallenstein but signed the first Pilsen Revers, which the emperor considered a betrayal. Hans Ulrich was beheaded and the family were deprived of all their possessions; his son Christoph Leopold (1632–1703) converted to Roman Catholicism and recovered all estates except Trachenberg. In 1654, Christoph Leopold became a count and was made imperial legate in Poland. In 1683, he accompanied John III Sobieski at the Battle of Vienna as the ambassador of the emperor. He was court tutor and court judge in Schweidnitz and Jauer, and chamber president and upper governor (German: Oberlandeshauptmann) of Silesia. His son Johann Anton Gotthard (1665–1742), created an imperial count (German: Reichsgraf), was director of the Silesian district authority (German: Oberamt). After Kynast Castle had burnt down, struck by lightning in 1675, the family moved to nearby Warmbrunn Castle, an early 17th-century renaissance building. It also burnt down in 1777 and was replaced from 1784 with a large neoclassicism palace which remained the main residence of the head of the family until 1945. After the Prussian capture of Silesia, Philipp Gotthard von Schaffgotsch (1715–1795) became bishop of Breslau, proposed by Frederick the Great who also made him a prince. When, during the Seven Years' War, the bishop went into exile in Bohemia, the king banned him for lifetime from returning. In the following generation, Johann Nepomuk Gotthard (1732–1808) received the title of "Erblandhofmeister". The family gained a seat in the Prussian House of Lords. In the first half of the nineteenth century, the family again split, into the Lower Silesian line of Warmbrunn-Kynast and the Upper Silesian of Koppitz. Due to the hot springs at Warmbrunn, the counts built a spa house and a theater in the early 19th century which became a fashionable retreat. When the Cistercian provost that Gotsche II Schoff had founded at Warmbrunn in 1381 was secularized in 1810, it became owned by the comital family and housed their 80,000 volume library and other collections. Count Hans Ulrich von Schaffgotsch (1831–1915) had married Johanna Gryczik in