The generation of magnetic fields of galaxies is usually described by the dynamo mechanism. This process is characterized by the Steenbeck – Krause – Rädler equation, which is the result of averaging the magnetohydrodynamics equations by distances which are associated with the size of turbulent cells in the interstellar medium. This equation is quite difficult to solve both from an analytical and numerical point of view. For galaxies, the no-z approximation is widely used. It describes the magnetic fields in thin discs. For such objects, where it is important to study the vertical structure of the field, it is not very applicable, so it is quite useful to adopt the RZ-model, which takes into account the dependence of the distance from the equatorial plane. During our research we have obtained the critical values of the dynamo number for galaxies with large half-thickness. We have also described typical z-structure for the magnetic field. Moreover, we have demonstrated that it is possible to generate dipolar magnetic fields.