the problem is how very many possible combinations of piece positions that can be accomplished in a single game of chess, much less over every game in existence. Not to mention when pieces get taken away, or when Queens are added to the board.
I have no idea how long it'd take, however I do know that brute forcing that would take an absolutely monumental amount of time and computing power, and that's with even the most efficient code.
Let's take an example, you have a fully set board.
First turn, you have 8 pawns that can move either 1 or 2 spaces, and 2 knights, that can each hit 2 positions, making the total number of outcomes 20. So you now have 20 boards. Now each of those 20 boards would have an additional 20 boards, from the same initial setup of Black, which makes the 2nd turn give you 20*20, or 400 unique combinations. It only gets worse from there as you get to the pieces that can move multiple spaces, and you have to add one scenario for each and every space they could move. A single queen alone could spawn 20 board configurations.
TL;DR - don't try to program this with Brute Force, I have no idea of any way to do it off the top of my head, and I'll probably be thinking about it for weeks now, but unless you don't want your computer to Crash due to running out of RAM, you'd better leave this one be.