The king put Benaiah1 son of Jehoiada over the army in Joab's position and replaced Abiathar with Zadok2 the priest.
References for 1 Kings 2:35
Then the king sent for Shimei3 and said to him, "Build yourself a house in Jerusalem and live there, but do not go anywhere else.
References for 1 Kings 2:36
The day you leave and cross the Kidron Valley,4 you can be sure you will die; your blood will be on your own head."5
References for 1 Kings 2:37
Shimei answered the king, "What you say is good. Your servant will do as my lord the king has said." And Shimei stayed in Jerusalem for a long time.
But three years later, two of Shimei's slaves ran off to Achish6 son of Maacah, king of Gath, and Shimei was told, "Your slaves are in Gath."
References for 1 Kings 2:39
At this, he saddled his donkey and went to Achish at Gath in search of his slaves. So Shimei went away and brought the slaves back from Gath.
When Solomon was told that Shimei had gone from Jerusalem to Gath and had returned,
the king summoned Shimei and said to him, "Did I not make you swear by the LORD and warn7 you, 'On the day you leave to go anywhere else, you can be sure you will die'? At that time you said to me, 'What you say is good. I will obey.'
References for 1 Kings 2:42
Why then did you not keep your oath to the LORD and obey the command I gave you?"
The king also said to Shimei, "You know in your heart all the wrong8 you did to my father David. Now the LORD will repay you for your wrongdoing.
References for 1 Kings 2:44
But King Solomon will be blessed, and David's throne will remain secure9 before the LORD forever."
References for 1 Kings 2:45
Then the king gave the order to Benaiah10 son of Jehoiada, and he went out and struck Shimei11 down and killed him. The kingdom was now firmly established12 in Solomon's hands.
References for 1 Kings 2:46