It’s easy to come up with several different reasons for the Obama administration’s moves against Russia and Israel.

The repudiation of his policies in last month’s election would have wounded a normal person’s ego, to say nothing of someone as vain as President Obama. To rub it in, the press has left the setting to follow the rising sun, reporting so much about President-elect Donald Trump that Obama had seemed quite forgotten.

The extraordinary burst of diplomatic activity over the last week, so unusual for a departing president, might therefore seem a piece of Obama’s petulant claim that he could have defeated Trump had he been able to run for a third term. It reminds one of the party Bill Clinton threw for himself after leaving office on George W. Bush’s Inauguration Day, in order to upstage the new president. When they leave office, recent Democratic presidents find it difficult to withdraw into a customary, dignified obscurity.

But there’s more to it than that. What is behind Obama’s attack on Russia and Israel is a pathetic attempt to tie the hands of the new administration, and to extend his rule beyond the two terms allotted a president.

It’s no secret that Trump seeks an accommodation with Russia and desires an end to the Israeli-Palestinian conflict, and that he’d pursue this in a very different manner from Obama and former Secretary of State Hillary Clinton.

By demonizing Russia, and withdrawing our historic support for Israel, Obama sought to place an insurmountable barrier to Trump’s two major foreign-policy initiatives, even as the flurry of enormously costly new regulations is meant to tie the hands of Trump’s domestic-policy advisers.

We have expelled 35 Russian diplomats as retaliation for that country’s attempt to influence our election. Given the ways in which Obama and the Democrats have sought to influence foreign referenda and elections, in Britain and Israel, that’s a bit rich.

More to the point, I haven’t seen any reports that the Russians did influence our election. We’re supposed to believe that the WikiLeaks transcripts came from Russia, even though Julian Assange has denied this. At most we seem to be talking about a phishing attack on John Podesta’s emails, which revealed that he didn’t think much of Catholic converts. Big deal. Most cradle Catholics have felt that way from time to time.

As for Israel, the recent Security Council resolution, on which the United States abstained after covertly encouraging it, is what one might have expected, given Obama’s poor treatment of our only democratic ally in the Middle East. Foreign-policy idiots will tell you that that’s all right, since Obama was merely picking a childish spat with Israeli Prime Minister Benjamin Netanyahu.

It’s easy to infer, therefore, that Obama would’ve been happy to stick it to Netanyahu, a man he so clearly despises. But then, American presidents aren’t supposed to do such things, with the door swinging behind them on the way out. And so we may conclude that Obama’s real target was Trump, not Netanyahu. America has voted for a new president, with a new foreign policy, and Obama proposes to undo this.

The question is, will he succeed in tying Trump’s hands? I doubt it. With Russia, any new sanctions would simply strengthen Trump’s bargaining leverage, as it gives him more cards to trade away. Remember that what Russian President Vladimir Putin seeks is legitimacy, the recognition that he is accepted as the head of state and government of a world power.

He is that, every inch of that, but the recognition that this is so matters greatly to him, and such recognition is something only America can grant. It’s not something to be lightly traded away, and the Trump administration will not grant it without exacting something in return.

I am assuming, of course, that the media’s over-the-top Russophobia, the wag-the-dog hysteria, will be quickly eclipsed by the new administration’s foreign-policy démarches. Until then, don’t let anyone persuade you to burn your copy of “War and Peace.”

And what of Israel? On the campaign trail, conservatives often pledge to move the embassy to Jerusalem. Obama just guaranteed that, this time, it’s going to happen. You can also expect payback against those countries that use the UN resolution as an excuse to change their policies toward Israel.

As for the United Nations itself, let’s not take it too seriously. The grand decisions about world peace aren’t made by bodies in which Venezuela counts equally with the United States, but by world powers, and it is only world powers such as the United States and Russia that hold the key to the resolution of the Israeli-Palestinian conflict. Which, of course, will suggest to the Russians a way to signal an opening to the new administration, by blocking any further attempt by Obama to harm Israel.

F.H. Buckley is a professor at Scalia Law School. His most recent book was “The Way Back: Restoring the Promise of America.”