Q. I’m wondering what the Halacha is for a mezuza (in its case) that falls or gets knocked down on Shabbat. It seems clear that it can be picked up from the ground, but its not clear to me if it should be re-attached on not. What if its just re-attaching a double sided tape? What if re-attaching it would involve nails and hammering? What if the nails are still attached to the mezuza case but are just loose in the wall and can be temporarily slipped back in?
thank you so much.

A. Sdei Chemed (letter Mem 115) quotes Poskim that permit placing back the mezuzah parchment that fell off its case, if and when putting it back does not involve closing the holder with force or even the possibility of doing so. He prohibits reattaching the case itself to the wall. See Piskei Teshuvos (313 n.38 and 323 n. 76), in regards to the issue of “fixing,” as the placing of the mezuzah permits the habitation in the house.
Shemiras Shabbos K. (23: n.117) also prohibits reattaching the mezuzah case to the wall if it involves any kind of nails or plugs, but permits placing it back into the opening inside the wall.
Horav Shlomo Miller’s Shlit’a opinion is that it is also prohibited to reattach the mezuza using double sided tape.

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