In bumpy UN dealings, Trump found backing on North Korea, isolation on Iran