After a donation and an inheritance among the high aristocracy, the castle was purchased in 1742 by the Imperial-Royal Court Chamber for Maria Theresa, the monarch of the Habsburg Monarchy, after university physicians confirmed in a report that a stay there would be good for the health of Empress Dowager Elisabeth Christine, Maria Theresa's mother.
In 1743, Maria Theresa commissioned her court architect Nikolaus Pacassi to expand the building into a palace and to design it as a residence for her mother. Pacassi made the former rear in the north the main front and also built the castle chapel, which still exists today, by 1745.
After the Empress Dowager's death in 1750, the castle stood empty for a long time. When Maria Theresa introduced the smallpox vaccination in 1762, she had it tried out on noble children in the initial phase, who then lived with their families in the castle for four weeks at the court's expense and received medical care.