Assuming you have a Fill in each group in the shape layer, I’d add an expression to each Fill so they each display a random brightness value from black [0,0,0] to white [1,1,1]. Then I’d use a Colorama effect on the layer (with Interpolate Palette set to Off!) to force the windows to your specific palette.
You can use an expression like this:
// use seedRandom to generate a "timeless" value
seedRandom(1, true);
// pick a random number between 0 and 1
var x = random();
// put that same random number into the red, blue and green channels
// to give us a brightness value. Keep alpha full!
[x,x,x,1]
I’ve attached a sample project that shows how it all works together. Please ask questions if anything isn’t clear!