It is narrated from Sayyiduna Abu Umamah (may Allah be pleased with him) that the Messenger of Allah (peace and blessings be upon him) said: "On Friday the angels are sent to the doors of the mosque, and they keep writing down the names of those who come, the first and then the next; then when the imam ascends the pulpit, the registers are rolled up."
Hadith Referenceالمعجم الكبير للطبراني / باب الصاد / 7660