It works for a wide variety of infections. Here's some copy-and-pasting from a very reliable reference that lists all the approved indications for use.
Oral treatment of urinary tract infections due to E. coli, Klebsiella and Enterobacter sp, M. morganii, P. mirabilis and P. vulgaris; acute otitis media in children; acute exacerbations of chronic bronchitis in adults due to susceptible strains of H. influenzae or S. pneumoniae; treatment and prophylaxis of Pneumocystis jiroveci pneumonitis (PCP); traveler's diarrhea due to enterotoxigenic E. coli; treatment of enteritis caused by Shigella flexneri or Shigella sonnei