of Poland's non-involvement, Poznań was affected by the Seven Years' War, because of its strategic location. Russian and Prussian troops alternately occupied the city from 1758 until 1763. There was much looting of property by the occupiers, and during the time of Prussian control the townspeople were forced to sell goods at vastly reduced prices or for counterfeit money. The city received no assistance from the Polish government of August III during these events, and the election of Stanisław August Poniatowski to the throne in 1764 was widely welcomed. However Poznań again suffered military occupation and conflict during the events involving the Bar Confederation, with Russian troops occupying the city in 1768–1769, followed by confederate troops in 1769–1770, Russians again in 1770–1771, Prussians in 1771–1773 (withdrawing after the First Partition of Poland had been ratified), and Russian troops again in 1773–1775. In 1778 a "Committee of Good Order" (Komisja Dobrego Porządku) was established in Poznań (a type of body introduced by acts of the Sejm in 1764 and 1768, to oversee the restoration of the kingdom's cities). Poznań's committee was headed by Kazimierz Raczyński, a former general, starosta of Wielkopolska and crown official. One of its first acts was to take an inventory, which showed that within the city walls there were 390 residential buildings (80% of them brick-built), and 57 public buildings (including the three main gates and around 30 wall towers). There were also 8 abbeys, 9 Catholic churches, a Protestant congregation and a synagogue. The Committee organized repairs and improvements to buildings, construction of buildings on unbuilt land, the building of a new wall, improvements to streets, and the removal of mills from the river to make it navigable. It also reformed the city government and attempted (with partial success) to bring the jurydyki under the city's control. In the events leading to the Second Partition of Poland, Poznań was occupied by a Prussian army on 31 January 1793. On 10 June an order was given that all Polish offices of government were to cease their activity by 4 July. Thus Poznań (or Posen, as it was known in German), along with all of Greater Poland, came under the control of Prussia. In the Prussian Partition for the first time (1793–1807) According to Prussian figures compiled in 1794, there were 4,738 people living within the city walls, as well as another 2,355 in the formerly independent Jewish