Mean-field theory and renormalization-group arguments are used to study the phase diagram of an anisotropic n-component d-dimensional magnetic system with a uniaxially random magnetic field. The resulting phase diagram is shown to be very similar to that of anisotropic antiferromagnets in a uniform field: For small random fields, the system orders along the direction of uniaxial anisotropy, with exponents which are related to those of nonrandom Ising systems in d-2 dimensions. For larger random fields, parallel to the direction of uniaxial anisotropy, the transverse n-1 spin components order, with exponents which are unaffected by the random field. The two regions are separated by a spin-flop first-order line, by an intermediate "mixed" phase, and by a tetracritical (or bicritical) point. The exponents at this multicritical point are shown to coincide, near d=6, with those of the random-field Ising model. This phase diagram is shown to describe the behavior of random-site spin glasses in a uniform magnetic field. Other types of anisotropic random fields, related experimental realizations and other generalizations are also mentioned. Although some of the quantitative results are found only near d=6, qualitative results are believed to apply at d=3 as well.