Polymer chains with one end grafted on a surface and exposed to a shear flow in the +x direction are modeled by a non-equilibrium Monte Carlo method using the bond-fluctuation model. In the dilute case of an isolated chain, the velocity profile is assumed to increase linearly 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 and orientations of isolated chains are obtained over a wide range of shear rates gamma, and the deformation of the coil structure by the shear is studied in detail. For brushes it is found that the density profile differs only little from the shear-free case, while the monomer distribution in the flow direction parallel to the wall is strongly modified. It is shown that the average scaled chain trajectory is a universal function independent of shear rate, and the results are discussed in terms of appropriate theories.