  We present a full analysis of a broadband spectral line survey of Sagittarius
B2 (Main), one of the most chemically rich regions in the Galaxy located within
the giant molecular cloud complex Sgr B2 in the Central Molecular Zone. Our
goal is to derive the molecular abundances and temperatures of the high-mass
star-forming region Sgr B2(M) and thus its physical and astrochemical
conditions. Sgr B2(M) was observed using the Heterodyne Instrument for the
Far-Infrared (HIFI) on board the Herschel Space Observatory in a spectral line
survey from 480 to 1907 GHz at a spectral resolution of 1.1 MHz, which provides
one of the largest spectral coverages ever obtained toward this high-mass
star-forming region in the submillimeter with high spectral resolution and
includes frequencies > 1 THz unobservable from the ground. We model the
molecular emission from the submillimeter to the far-IR using the XCLASS
program. For each molecule, a quantitative description was determined taking
all emission and absorption features of that species across the entire spectral
range into account. Additionally, we derive velocity resolved ortho / para
ratios for those molecules for which ortho and para resolved molecular
parameters are available. Finally, the temperature and velocity distributions
are analyzed and the derived abundances are compared with those obtained for
Sgr B2(N) from a similar HIFI survey. A total of 92 isotopologues were
identified, arising from 49 different molecules, ranging from free ions to
complex organic compounds and originating from a variety of environments from
the cold envelope to hot and dense gas within the cores. Sulfur dioxide,
methanol, and water are the dominant contributors. For the ortho / para ratios
we find deviations from the high temperature values between 13 and 27 %. In
total 14 % of all lines remain unidentified.
