This script runs the Posterize filter on all layers in an image.
Download the script here-> FP's Posterize All Layers...In the preview image, the left side is untouched and the right side is posterized.
You choose the posterize level and the script does the rest.
Download the zip file, open the zip file by double-clicking on it and copy/paste the script to your GIMP scripts folder (ie...C:\Program Files\GIMP-2.0\share\gimp\2.0\scripts). Refresh your scripts and you're ready to go. The script can be located under the Colors > Posterize All Layers...
Let me know if you have any trouble or need additional information.
Art