How to Mass delete splogs in buddypress/bbpress (multisite) ?

Hi,

Over the last couple of weeks I had some massive spam attack where 5000 users were created and each created their own bp group and posts. This of course creates all sorts of metadata that will need to be removed. I was wondering how to go on about it without creating orphan content in the database. Is there a query or some sort of directions I can follow to do this correctly?