Cattle is a reservoir of potentially pathogenic E. coli, bacteria that can represent a significant threat to public health, hence it is crucial to monitor the prevalence of the genetic determinants of virulence and antimicrobial resistance among the E. coli population. The aim of this study was the analysis of the phylogenetic structure, distribution of virulence factors (VFs) and prevalence of antimicrobial resistance among E. coli isolated from two groups of healthy cattle: 50 cows housed in the conventional barn (147 isolates) and 42 cows living on the ecological pasture (118 isolates). The phylogenetic analysis, identification of VFs and antimicrobial resistance genes were based on either multiplex or simplex PCR. The antimicrobial susceptibilities of E. coli were examined using the broth microdilution method. Two statistical approaches were used to analyse the results obtained for two groups of cattle. The relations between the dependent (VFs profiles, antibiotics) and the independent variables were described using the two models. The mixed logit model was used to characterise the prevalence of the analysed factors in the sets of isolates. The univariate logistic regression model was used to characterise the prevalence of these factors in particular animals. Given each model, the odds ratio (OR) and the 95% confidence interval for the population were estimated. The phylogroup B1 was predominant among isolates from beef cattle, while the phylogroups A, B1 and D occurred with equal frequency among isolates from dairy cattle. The frequency of VFs-positive isolates was significantly higher among isolates from beef cattle. E. coli from dairy cattle revealed significantly higher resistance to antibiotics. Some of the tested resistance genes were present among isolates from dairy cattle. Our study showed that the habitat and diet may affect the genetic diversity of commensal E. coli in the cattle. The results suggest that the ecological pasture habitat is related to the increased spreading rate of the VFs, while the barn habitat is characterised by the higher levels of antimicrobial resistance among E. coli.