I don't have a full understanding of it, but I think a Motion to Quash basically asks the court to say "This information was collected illegally or outside the investigative scope, and you may not use it as evidence (and thus must destroy it)"
The main remedy for illegal police searches is exclusion of the evidence if, and when, the government attempts to use it in court (and then, usually, only if they attempt to use it against the specific person whose rights were violated by the search, and not always even then [e.g., good faith exception, and other exceptions to the exclusionary rule].)