Bach had two periods of employment in Weimar, with two different employers, and keeping track of the details of these sojourns can be difficult as the given names of his employers were similar, yet the locations of their residences were different.
Duke Johann-Ernst II had two sons who, in the absence of the right of primogeniture, inherited shared rule of Saxe-Weimar. The elder and more dominant of the two was named Wilhelm Ernst, and he resided at Wilhelmsburg Palace. The younger, Johann-Ernst III, whose health was failing, temporarily employed Bach for a few months at the beginning of 1703 as a violinist in the private chamber orchestra that he maintained at his residence at the Red Palace.
Following intervening assignments in Arnstadt and Mülhausen, Bach returned to Weimar in 1708 and went to work for the older Wilhelm Ernst Bach as a court musician at the Wilhelmsburg. Johann-Ernst III was now dead, and his eldest son, Ernst August, had ascended to the position of co-regent with Wilhelm Ernst, but he, too, was generally the more deferential of the pair.
Ernst August resided at the Red Palace, and whenever Bach’s official duties for Wilhelm Ernst had been completed, Bach had permission to turn his attention to the musical activities taking place there. Ernst August’s younger half-brother also resided in the Red Palace, and this youngest Johann Ernst studied keyboard and counterpoint with Bach’s cousin Johann Gottfried Walther. Johann Ernst’s musical skills must have been more than adequate as Bach transcribed three of his concertos for his own use as solo harpsichord concertos (BWV 982, BWV 984 and BWV 987).
Increasing friction between the two competing Weimar households at the Wilhelmsburg and Red Palaces eventually caused Bach to seek alternative employment in Cöthen.