Current antibiotics tend to be broad spectrum, leading to indiscriminate killing of commensal bacteria and accelerated evolution of drug resistance. Here, we use CRISPR-Cas technology to create antimicrobials whose spectrum of activity is chosen by design. RNA-guided nucleases (RGNs) targeting specific DNA sequences are delivered efficiently to microbial populations using bacteriophage or bacteria carrying plasmids transmissible by conjugation. The DNA targets of RGNs can be undesirable genes or polymorphisms, including antibiotic resistance and virulence determinants in carbapenem-resistant Enterobacteriaceae and enterohemorrhagic Escherichia coli. Delivery of RGNs significantly improves survival in a Galleria mellonella infection model. We also show that RGNs enable modulation of complex bacterial populations by selective knockdown of targeted strains based on genetic signatures. RGNs constitute a class of highly discriminatory, customizable antimicrobials that enact selective pressure at the DNA level to reduce the prevalence of undesired genes, minimize off-target effects and enable programmable remodeling of microbiota.