It is enormously faster to use
x = f /. {M -> 2, λ -> 100} // Simplify; FindRoot[Im[x], {ω, 5}] Then, given the space of roots for Im[x]
DeleteCases[Union[Table[ω /. FindRoot[Im[x], {ω, i}], {i, 50}], SameTest -> (Abs[#1 - #2] < 10^-8 &)], z_ /; z < 0 || z > 50, Infinity] finds all positive roots less than 50
(* {1.42102, 4.90807, 7.62768, 11.2423, 14.0252, 17.1884, 20.6867, 23.5686, 26.4905, 29.8494, 33.2229, 36.4292, 39.4662, 42.4597, 45.5127, 48.6259} *) These results are consistent with a Plot of x.
Plot[{Re[x], Im[x]}, {ω, 0, 50}] 