Endgrafted polymers at surfaces exposed to a shear flow are modeled by a nonequilibrium Monte Carlo method where the jump rate of effective monomers to neighboring lattice sites against the flow direction is smaller than in the flow direction, assuming that this difference in jump rates is proportional to the local velocity of the flowing fluid. In the dilute case of isolated chains, the velocity profile is assumed linearly increasing with the distance from the surface, while for the case of polymer brushes the screening of the velocity field is calculated using a parabolic density profile for the brush whose height is determined self-consistently. Linear dimensions of isolated chains are obtained over a wide range of shear rates γ̇, and the deformation of the coil structure by the shear is studied in detail. For brushes it is found that the density profile and the distribution for the perpendicular coordinate zN of the free ends differ only little from the shear-free case, while the distribution of the free end coordinate XN parallel to the wall in the flow direction gets strongly modified. It is shown that the average scaled chain trajectory ( 〈zi〉/〈zN〉 as a function of 〈xi〉/〈xN〉, i labels the monomers along the chain) is a universal function independent of shear rate, while 〈xN〉 depends on γ̇, chain length N and grafting density σ in scale form, 〈xN〉/ (σ1/3N3γ̇) is a function of N 2σ5/3 only. Our results are compared with the recent theories of Rabin and Alexander or Barrat, respectively, and both similarities and differences are noted and discussed. The observed increase of the coil radius with the inclination of the chain produced by the flow is somewhat smaller in our model than it was in those theories.