A man has been given a criminal behaviour order to help protect businesses.