After paying off a pornographic film actress and doing other tasks to help his boss win the presidency, Michael D. Cohen was surprised to find that the doors to the White House were mostly closed to him.

Mr. Cohen did not land a hoped-for job in President Trump’s administration — he imagined himself as chief of staff — and in January last year he left the Trump Organization, where he had long served as the in-house fixer without a clear portfolio. But he managed to turn what looked like an exile into a lucrative opportunity.

Armed with the self-appointed title of “personal attorney” to the president, Mr. Cohen, who had served as a personal-injury lawyer and owned a taxi business, became seen as the man who could help others gain access to the seat of power that had been denied to him. Major corporations including AT&T, Novartis and the law firm Squire Patton Boggs collectively paid him over $2 million for advice about navigating the suddenly foreign terrain of Mr. Trump’s Washington.

Most of the arrangements remained a secret until Tuesday, when details first appeared in an account released by Michael Avenatti, the lawyer for Stephanie Clifford, the actress who was paid $130,000 to keep quiet about her alleged affair with Mr. Trump and is now suing to be released from the agreement. The New York Times confirmed many of Mr. Avenatti’s disclosures through a review of financial records.