Q. ( See above question 1977). How can someone comply with a mitzva if one is totally unaware of the mitzva being done?
A. Horav Shlomo Miller’s Shlit’a opinion is that one can comply. This being similar to someone missing a mezuza on his door and a friend replacing it without his knowledge. Since we assume that the person will consent to the mezuza being replaced or placed back if he knew. The same can apply also to a “maakah” or security fence required in a house, for protecting people from falling. As we say; “Zochin Leodom Shelo Befonov,” You can merit someone with something, that we know is in his benefit, even if he is unaware.(Kiddushin 23a).
Rabbi A. Bartfeld as revised by Horav Shlomo Miller Shlit’a