WASHINGTON — President Trump on Saturday signed an executive order that strengthens certain restrictions on lobbying that had been adopted under President Obama, while weakening others.

Executive branch employees, including those in the White House, will now be barred for five years after they leave government from lobbying the federal agency where they worked. Under Mr. Obama, they had to wait until the end of the administration, meaning a shorter ban for some departing officials. Former executive branch officials will now also be permanently banned from serving as foreign lobbyists.

“Most of the people standing behind me will not be able to go to work,” Mr. Trump joked about their prospects after serving in the White House during a short signing ceremony in the Oval Office as advisers — including his chief strategist, Stephen K. Bannon, and counselor, Kellyanne Conway — stood behind him.

Mr. Trump also signed two other memos. One outlined a reorganization of the National Security Council that appeared to include a significant change from the Obama administration, one that would expand Mr. Bannon’s power in the administration.