Q. Hello. I very much enjoy reading these questions/answers! Here is my first question: What should be done with a mezuza that gets accidentally knocked or is found already knocked down on Shabbat or Yom Tov?
Is there any difference it they were help up by nails or 2 sided tape? Is there any difference depending on what room the mezuza is on? (shul, room in a house, openings in a house without a door, etc) . And any difference for Askenazim vs. Sephardim?

Would a bracha be said on replacing the mezuza on the doorpost if I am putting it back up on Shabbat? And if it is delayed until after Shabbat, does it get a bracha then? What it I didn’t knock it down, but found it laying on the ground and it might have been there for days…also gets a bracha?

Thanks so much

A. A mezuza that fell cannot be replaced on Shabbat or Yom Tov, since this constitutes a building act and is included in the prohibited melacha (one of the thirty nine categories of forbidden work) of Boneh or building and erecting. It would not make a difference whether the mezuza is attached with nails, glue or tape.
It also does not matter where the mezuza was (shul or house) it cannot be re-attached on Shabbat or Yom Tov.
However, immediately after the end of these days, it should be replaced with a bracha. Taking care that indeed the mezuza remained kasher (it could have been damaged when it fell or was on the ground,) and that the door or entrance also qualifies for mezuza. (it may be missing a doorpost or the lintel, or have other deficiencies.)
It also does not make a difference how long it was laying on the ground, when it fell accidentally. Nonetheless, if it was taken down intentionally (for checking the mezuza or fixing the door) you do not usually recite a brocho when re-attaching it. (See following question)
In general it is better to affix a mezuza using nails, as it is a stronger and longer-lasting attachment.
The above applies to both, Sephardim and Ashkenazim.

Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a