Abdullah bin Amr bin As reported,

The Prophet ﷺ, when he entered the mosque, would say, "I seek refuge in Allah the Magnificent, in His Noble Face, and in His Eternal Authority, from the accursed Satan."He asked, "Is that all?"I replied, "Yes."He said, "When he says that, Satan says, 'He is protected from me for the rest of the day.'"

Azami 3039

Hasan

عن عبد الله بن عمرو بن العاص

عن النبي ﷺ أنه كان إذا دخل المسجد قال: أعوذ بالله العظيم، وبوجهه الكريم، وسلطانه القديم، من الشيطان الرجيم قال: أقط؟ قلت: نعم قال: فإذا قال ذلك: قال الشيطان: حفظ مني سائر اليوم.

الأعظمي 3039حسن
Contents
Reference
Commentary
Ayat
Collection
Jami al-Kamil
Book
Mosques
Section
What to say when entering the masjid
Numbering
Jami al-Kamil 3039 (2nd edition)
Azami 3039