The proprietors of 21 guesthouses will be prosecuted after their premises were found to be operating illegally.