Attorney General Eric Schneiderman settled with six ticket brokers Wednesday, accused of selling hundreds of thousands of illegal tickets for several New York events including a Beyoncé concert at the Barclays Center.

Schneiderman said since 2011 several of the companies would use illegal software — known as “bots” -- to buy a large number of tickets on sites like Ticketmaster. They would then resell them at a large profit through sites like StubHub or Vivid Seats.

“Our office has zero tolerance for ticket resellers that use illegal bots to scoop up large numbers of tickets for popular events before consumers can obtain them, and then resell those tickets to those very same consumers at a large markup,” Schneiderman said in a statement. “New Yorkers deserve a fairer ticket marketplace. Our office will continue to enforce New York’s ticket laws by investigating ticket brokers who are breaking our laws, and making them pay for their illegal acts.”

The companies are based in several states, including New York, Florida, and Utah. Each company will pay into the settlement, which totals more than $2.7 million.

One of them, a New Jersey-based ticket company, illegally bought 530 tickets to the 2013 Beyoncé concert in Brooklyn, all within three minutes, according to the AG’s office. In a separate incident, a ticket company bought up 522 tickets within five minutes to a June 2013 One Direction concert at Jones Beach.