A Preston landlord has been prosecuted after putting the lives of tenants at risk.