A retired NYPD officer convicted of misusing city resources to benefit a Mayor Bill de Blasio donor was all smiles Wednesday after he was sentenced to two years’ probation and 180 hours of community service tied to a corruption probe that rocked the NYPD when it was announced two years ago.

Ex-NYPD Deputy Chief Michael Harrington hugged and shook hands with supporters after Manhattan federal Judge Gregory Wood gave him the slap-on-the-wrist sentence.

The former right-hand man of the NYPD’s then-Chief of Department Philip Banks initially was charged with accepting bribes from de Blasio donors Jeremy Reichberg and Jona Rechnitz in a case that sent shockwaves through the NYPD when arrests were made in 2016.

But Harrington ended up copping to one charge of misusing resources to benefit Reichberg, including securing a police boat for a private event Reichberg was hosting, as part of an agreement hashed out with the government.

He faced up to six months in prison on that charge.

Harrington’s lawyer argued that he should get time served, saying he’s been a “scapegoat” for the feds at a time when other high-ranking officials also received gifts from Reichberg and Rechnitz — a clear reference to Banks.

“The $64,000 question is: Where are all these other high-ranking officials?” lawyer Andrew Weinstein said. The government is “using their time today trying to use Mike Harrington as a scapegoat,” Weinstein said.

Rechnitz, a government cooperator, has testified in a related case that he showered gifts on Banks, including steak dinners, a trip to Israel and a backgammon set, as well as on other officers who were also not charged.

Banks, who is now retired, has denied that he did anything wrong.

Prosecutor Martin Bell scoffed at the notion that Harrington is a scapegoat, saying he “was among the most powerful” people who benefited from Rechnitz and Reichberg.”

Harrington did “clear things he should not have done … that’s why Mr. Harrington is here,” Bell said.

Harrington’s co-defendants, Reichberg and ex-NYPD officer James Grant, will go on trial for bribery in October.