Sunan an-Nasa'i 1559
It was narrated that Muhammad said:
"I met Umm 'Atiyyah and said to her: 'Did you hear the Messenger of Allah (ﷺ) say (anything)?' When she mentioned him, she would say: 'May my father be ransomed for him.' (He said) 'Bring out the adolescent girls and the women in seclusion and let them witness goodness and the supplication of the Muslims, but let the menstruating women keep away from the place where the people pray.'"
أَخْبَرَنَا قُتَيْبَةُ، قَالَ حَدَّثَنَا سُفْيَانُ، عَنْ أَيُّوبَ، عَنْ مُحَمَّدٍ، قَالَ لَقِيتُ أُمَّ عَطِيَّةَ فَقُلْتُ لَهَا هَلْ سَمِعْتِ مِنَ النَّبِيِّ صلى الله عليه وسلم وَكَانَتْ إِذَا ذَكَرَتْهُ قَالَتْ بِأَبَا قَالَ ‏
"‏ أَخْرِجُوا الْعَوَاتِقَ وَذَوَاتِ الْخُدُورِ فَيَشْهَدْنَ الْعِيدَ وَدَعْوَةَ الْمُسْلِمِينَ وَلْيَعْتَزِلِ الْحُيَّضُ مُصَلَّى النَّاسِ ‏"‏ ‏.‏