Such a marriage contract is invalid, null and void, and is not binding as reported in a hadith transmitted by Muslim and others. It is reported that ‘Uthman ibn ‘Affan said: The Prophet (peace be upon him) said: “A muhrim must not contract marriage, nor help others contract marriage, nor get engaged for marriage.” Malik, Ash-Shafi’i, Ahmad, and Ishaq are also of the same opinion. They hold that it is not permissible for a muhrim to contract a marriage and regard any marriage thus contracted as invalid. Tirmizhi has also reported it but without the words “nor get engaged for marriage.” Tirmizhi considers this a sound hadith and remarks that the Companions of the Prophet (peace be upon him) practiced it.
Some of the reports that say the Prophet (peace be upon him) “married Maimunah while he was a muhrim” are contrary to the report transmitted by Muslim that “he married her while he was no longer in the state of ihram.”
Tirmizhi said: “There is disagreement concerning the marriage of the Prophet (peace be upon him) to Maimunah, for he married her on his way to Makkah. Some said: ‘He married her before he put on ihram, but the news of his marriage became known while he was in the state of ihram. Later he consummated his marriage with her in Saraf, on the road to Makkah, after he was free from the restrictions of ihram.’
Hanafi scholars, however, hold that a muhrim may contract a marriage, because in the state of ihram what is forbidden is not marriage with a woman, but only the consummation of marriage. Contracting a marriage is permissible, but intercourse is forbidden.: Wearing Kohl in the Eye