Heteroarylpiperidine derivatives and heteroarylpiperazine derivatives of the formula (I) wherein the symbols have the definitions given in the description, and also their pesticidally active salts, and also the harmful Their use for controlling phytopathogenic fungi, and furthermore the use of compounds of formula (I) Or a salt thereof.式(I)〔式中、記号は明細書中で示されている定義を有する〕で表されるヘテロアリールピペリジン誘導体及びヘテロアリールピペラジン誘導体及びさらにそれらの農薬的に活性な塩、並びに、有害な植物病原性菌類を防除するためのそれらの使用、並びに、さらに、式(I)で表される化合物を調製する方法。