The present work models and studies the resonance frequency change due to adsorption phenomena in a simply-supported adatom-microbeam system under an axial magnetic environment. The microbeam structure is a functionally graded (FG) sandwich that includes a rectangular configuration and a ceramic perforated core with periodic square holes network and FG porous material faces. To evaluate the adsorption-induced energies produced by van der Waals interaction (vdW), the Morse and Lennard-Jones (6–12) potentials are included in conjunction with nonlocal material elasticity to adopt the small-scale impact. Moreover, the explicit formulas for the inertia moments and shear force are developed by the Timoshenko beam equations, considering the residual stress influence as an additional axial load. The Navier-type solution and the differential quadratic method (DQM) are implemented to compute the solution of the governing equations. It is established that the resonance frequency change for the O/Si (100) and H/Si (100) is dependent on the geometrical, perforation, and porosity parameters, adsorption density, mode number, and the magnetic field intensity as well. Therefore, these numerical results have been discussed in detail to properly examine dynamic vibration behavior and a suitable mass detection design of M/NEMS structures.