Abiathar the priest, according to the judgement against his father Eli, was removed from the priesthood and exiled to Anathoth. Joab had defected to Adonijah, so he was marked for death. When he heard that Solomon intended to execute him, he went into the tabernacle and took hold of the horns of the altar. Benaiah ordered him to come out of the tabernacle. When he refused, Solomon ordered him to strike Joab down in the tabernacle to avenge the innocent blood Joab shed. Benaiah did just that, and he was buried in his own house in the wilderness. Benaiah was elevated to leader of the army of Israel, and Zadok took the place of Abiathar as priest. Solomon called for Shimei, and instructed him to build a house in Jerusalem, and warned him that the day he crosses the Brook Kidron he would die. Shimei agreed and dwelt in Jerusalem many days. After three years, two of Shimei’s slaves ran away to Gath, and Shimei went to retrieve them. Solomon found out about it, and called for Shimei. David had Benaiah strike Shimei down, and after these enemies were killed, the kingdom was firmly established for Solomon.
This is primarily the continuation of Solomon’s getting those who opposed him out of the kingdom. After this housecleaning, Solomon could have rest on all sides.