President Abdu Rabbu Mansour Hadi announced a purge of Yemen’s military leadership on Wednesday that could sideline relatives of his autocratic predecessor, Ali Abdullah Saleh, who agreed to step down in November 2011 but whose continued influence has troubled Yemen’s brittle transition. Mr. Hadi restructured the military in December, but the moves announced Wednesday were more far-reaching, removing Mr. Saleh’s son and two nephews from powerful security posts as well as from the country. Officials said that Mr. Saleh’s son, who was the head of the Republican Guard, had been appointed ambassador to the United Arab Emirates, and that the nephews had been made military attaches in Ethiopia and Germany.