UK Anti-Doping officials found traces of Higenamine in a urine sample provided by the 22-year-old following Barnsley's match against Blackburn on 23 November 2019.
An FA statement read: "Bambo Diaby has been suspended from all football and football-related activity for two years following a breach of The FA's Anti-Doping Regulations.
"The Barnsley FC defender provided an in-competition urine sample to The FA and UK Anti-Doping officials on 23 November 2019 that was found to contain Higenamine once analysed.
"The World Anti-Doping Agency classifies Higenamine as a prohibited substance at all times and he was subsequently charged by The FA for a breach of its Anti-Doping Regulations.
"While Bambo Diaby admitted the charge, he did not establish how the Higenamine entered his system. As such, an independent Regulatory Commission imposed the mandatory two-year ban.
"The suspension is effective from the date of the player’s provisional suspension on 17 January 2020 and will run up to and including 16 January 2022."
Diaby took to Twitter immediately after the announcement, where he maintained his innocence and insisted he would fulfil his "dream".