WASHINGTON—A new acting secretary of defense has taken the reins at the Pentagon, vowing to work with President Trump to fulfill his goals for the military amid a broader transition across the Defense Department and the administration.

Pat Shanahan, a onetime Boeing Co. executive and previously the deputy secretary, was chosen by Mr. Trump after the president removed Defense Secretary Jim Mattis, who had submitted a resignation letter that cited his differences with the White House.

...