It is narrated from Sayyidah Umm Salamah (may Allah be pleased with her) that the Messenger of Allah (peace and blessings be upon him) came out to the open courtyard of the mosque and called out in a very loud voice: "Beware! Indeed this mosque is not lawful for anyone who is junub (upon whom ghusl is obligatory) or for a menstruating woman, except for the Prophet (peace and blessings be upon him), his wives, Ali and Fatimah (may Allah be pleased with them). Take heed! Have I not made the names clear to you so that you do not go astray?"
Imam Ibn Majah narrated it through the chain of Abu Bakr bin Abi Shaybah, but in his narration the words from "except for the Prophet (peace and blessings be upon him)" to the end of the hadith are not mentioned.
Hadith Referenceالمطالب العالية بزوائد المسانيد الثمانية / كتاب الغسل / 182
Hadith Gradingمحدثین:إسناده ضعيف جدًا، معضل
Hadith Takhrij«حکم الحدیث المطالب العالیہ محققاً تنسیق د. سعد بن ناصر بن عبد العزيز الشَّثري- مکتبہ شاملہ :إسناده ضعيف قال إبن حزم: أما محدوج فساقط يروي المعضلات عن جسرة وأبو الخطاب مجهول فسقط هذا الخبر ، الإعلام بسنته عليه الصلاة والسلام بشرح سنن ابن ماجه الإمام: (3 / 144) » «أخرجه ابن خزيمة فى «صحيحه» برقم: 1327، وأبو داود فى «سننه» برقم: 232، وابن ماجه فى «سننه» برقم: 645، والبيهقي فى«سننه الكبير» برقم: 4392، 4393، 13532، وأورده ابن حجر فى "المطالب العالية"، 182، وأخرجه الطبراني فى«الكبير» برقم: 883»