Scale/distort cuboid to meet certain corner marks

Hi there,

I have an assembly of closed polygons, which basically constitute a rectangular plane. I have then slightly rotated this assembly in order to get a predefined orientation. However, due to the rotation, the corner points of the surfaces have shifted away from their prior position.

I would now need to distort the whole thing in such a way, that the corner points again lie on the axis of their old positions, while the new orientation of the polygonal surface is still maintained. I hope my illustration makes it a bit clearer:

So far, I have not been able to do that, since I can’t modify it based on points, since that would only distort one of the polygons, but not the assembly as a whole.

Any idea?
Thanks a lot!