"It's a worrying and dangerous measure," Ayrault told members of the French community at the ambassador's residence in Tehran. "It has nothing to do with the fight against terrorism."
Trump's executive order temporarily bans nationals from Syria, Iraq, Iran, Yemen, Sudan, Somalia and Libya from entering the US, while security measures are tightened.
Calling for clarification from the US authorities, Ayrault called it "unacceptable and punitive for those concerned, pointing out that it means "great uncertainty for people with dual nationality".
Asked if it should be rescinded, he replied: "Yes, I think so. I think that would be common sense."
Trump has said that visas will be issued to citizens of the seven countries again in 90 days' time.
Defends nuclear deal
Ayrault also reassured Tehran that France stands by the nuclear deal with Iran, which led to the lifting of sanctions and a revival of Franco-Iranian trade ties.
During the US election campaign Trump branded it "the worst deal ever negotiated", saying he would either rip it up or seek a better agreement.
Ayrault said it was in the "common interest" that the 2015 accord, under which Iran agreed to curb its nuclear program in return for lifted sanctions; was obeyed.
"I'm coming as the defender of the accord, but to be vigilant and explain that they [the Iranians] must be irreproachable," Jean-Marc Ayrault told reporters after landing in Tehran.
"We harbour real concerns about the US administration's attitude towards this agreement," he said.