Q. Does a Shalom Zochor have to be in the house where the mother and baby are, or can it be also, if needed in a friends house?
A. A number of reasons are given to the tradition of making a Sholom Zochor Seudah (meal), which many Poiskim consider a Seudas Mitzvah (Remah Y.D. 265,12). Most explain it as an expression of praise and thanksgiving to Hashem, for the newborn's gift of life and his and his mothers safe delivery (Baba Kama 80b - Tos. Ibid). Some see it as a honour given to the great mitzvah of Shabbos before carrying on with the Brith Milah. Accordingly the Sholom Zochor does not have to be in the house where the newborn is.
Some understand its origin as a manifestation of Aveluth or consolation for the child's forgetting the Torah that he had learned prenatally, and being in mourning for it (Taz, Drisha, ibid.). Others see in it an act of reminding the newborn of the oath he has taken before being born and its compliance. This would be done best in his presence.
However, whenever it is necessary the Sholom Zochor can be done in Shul or in a friend's house.
Rabbi A. Bartfeld as advised by Horav Shlomo Miller Shlit"a