Q. Why do we say shalom aleichem in kiddush levana?

A. A number of reasons are mentioned for saying Shalom Aleichem at Kidush Levana; some are:
1) Mishna Berura (426: 16) quotes from Mogen Avrohom that we say Sholom Aleichem, since we recite before three times; “Tipol Aleichem eimasa vafachad”, (Shemos15: 16). This verse is a curse to our enemies. Therefore, we quickly turn to our fellow Jews and bless them three times with peace.
2) Levush, Maharil-Teshuvos 47, Or Zarua 2: 456, mention that it is due to the joy and happiness inherent in receiving the Shechina at Kidush Levana.
3) Midrash teaches that the first ever recorded quarrel was the dispute between the moon and the sun, where the levana claimed against the sun; two kings cannot use the same crown. After Hashem punished and diminished the moon, the sun, in a profound gesture of peace and forgiveness still provided his light for the moon to reflect, and repaid her with kindness instead of anger. An example for us to emulate (Pri Eitz Chaim 208:3, Otzar Minhagei Yeshurun p.236.)
4) Since the Batey Knesset where in ancient times in the fields and there was danger in walking home from them at night (Tosafos Brachos 3,) they would wish and bless each other Sholom. (Machanaim p.157)
5) Pirchei Nissan maintains that once Kidush Levana has been recited, the fear of an untimely demise on that month is mitigated (Sidur Iyun Tefila p. 543.)
6) The fact that one has received the presence of the Shechina, makes him a new being, and thus requires greeting. Some see a spark of Techias Hamesim and resurrection in the renewal of the moon mentioned in this brocho (Kovetz Chachmei Lev p. 1030)
Horav Shlomo Miller Shlit”a indicated that a fundamental reason lays on seeking the brocho given by those who respond, thus receiving a blessing in the appropriate time of Kabbolas Pnei Hashechina.

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