It is narrated from Sayyiduna Abu al-Darda' (may Allah be pleased with him) that he used to say: "When I enter the mosque, I say: 'Al-salamu alayka ya Rasul Allah' (Peace be upon you, O Messenger of Allah (peace and blessings be upon him)), and when I leave the mosque I say the same words too."
Hadith Referenceإتحاف الخيرة المهرة بزوائد المسانيد العشرة / كتاب المساجد / 987
Hadith Gradingمحدثین:إسناده ضعيف موقوفًا على أبي الدرداء؛ لانقطاع يزيد بن قسيط عنه