He’s getting the old cast back together.

President Trump hinted Thursday that he may use his power to tidy up the criminal records of two of his pals from his days hosting and producing “The Apprentice.”

Trump is mulling a pardon for ex-con Martha Stewart and commuting the sentence of incarcerated former Illinois Gov. Rod Blagojevich.

At the same time, he could deliver a black eye to his nemesis, former FBI Director James Comey — who was the prosecutor who put Stewart away for five months on charges of conspiracy and making false statements to federal investigators as they probed her for insider trading related to pharmaceutical company ImClone.

And Comey’s prosecutor pal Patrick Fitzgerald got Blagojevich a 14-year prison sentence for trying to sell President Barack Obama’s old Senate seat.

Blagojevich, a Democrat, did an 11-episode stint on Trump’s reality show “The Apprentice” in 2010, according to IMDb.

Trump produced Stewart’s ill-fated Apprentice spinoff “The Apprentice: Martha Stewart” — appearing on one episode during the show’s one-season run, according to IMDb.

But the two got embroiled in a bitter feud after she told Newsweek that she thought she would begin her version of the reality show by turning Trump’s catchphrase “You’re fired” against him — making hers the only version of the reality show.

Trump slapped back in an open letter at the time that jabbed her for the insider trading scandal.

“Essentially, you made this firing up just as you made up your sell order of ImClone. The only difference is — that was more obvious. Putting your show on the air was a mistake for everybody — especially NBC,” he seethed.