I Kings - Chapter 2
With Friends Like These, Who Needs Enemies?
David was nearing death, so he called Solomon to his side. He charged him with always following G-d and Torah so that he would be worthy of G-d's promise to be with their descendants. David then told Solomon to punish Yoav. Yoav killed Avshalom counter to David's orders, plus Avner and Amasa, who had defected to David's side. While David did not consider himself in a position to punish Yoav, Solomon could do so. David also told Solomon to treat the descendants of Barzilai well, for their father's aid when David fled from Avshalom. Finally, David warned Solomon not to trust Shimei ben Gera. Shimei was an opportunist; when David was down, he kicked him. When David was back up, he groveled. Shimei should be dealt with at the first sign of trouble, David said.
David passed away at the age of 70, having reigned a total of 40 years. Solomon assumed the throne.
Adoniyahu, Solomon's brother who had tried to assume the throne, approached Solomon's mother, Batsheva, with what seemed a reasonable request: he wanted to marry Avishag, who had served as David's attendant in his final days. Batsheva agreed to speak to Solomon about it.
Solomon, however, was pretty sharp. He saw Adoniyahu's request for what it was: a subtle attempt to get a foot in the door. No one may marry a king's widow or concubine except for another king. By marrying Avishag, Adoniyahu would be sending the message that he truly was fit to be king. Solomon had told Adoniyahu that he would be safe so long as he proved loyal. So that was it for Adoniyahu.
Solomon then fired Evyasar from being Kohein Gadol (High Priest). This was because he had supported Adoniyahu's bid for the throne. But he did not execute him because he had been a loyal servant of G-d and shared David's troubles.
Yoav heard what was going on and he was worried because he had sided with Adoniyahu. He ran to the altar and grabbed onto it but, as we said in the last chapter, the altar doesn't grant sanctuary to a murderer and Yoav was guilty of murder. Yoav refused to come out, so Solomon had him killed on the spot. Solomon then appointed Benayahu his new general and Tzadok became the new Kohein Gadol.
Solomon also put the troublemaker Shimei on probation - he was not to leave Jerusalem ever, for any reason. The day he violated this, he would be executed. Shimei was grateful for the clemency and agreed to the terms. (As if he had a choice!)
Three years later, two of Shimei's slaves escaped and he went to retrieve them. (He either figured that he had been on such good behavior that Solomon wouldn't mind, or he was so preoccupied with recovering his lost property that he just forgot.) Solomon found out and kept his word.
Having dispatched Adoniyahu, Yoav and Shimei - about whom one might say, "with friends like these, who needs enemies?" - Solomon's kingdom was firmly established.