How do you deal with extreme behaviour (trolls, spammers, etc)?

If a user enrols on a course only to cause trouble, repeatedly posting comments that break our code of conduct, we will immediately delete their account and hide all of their comments. They will be notified by an email explaining why.