EMP is like a huge burst of radio waves, any metal object will absorb it like an antenna and produce a voltage spike. The power grid is a huge antenna, the power pumped into it will be massive. About all you can do is connect lighning arrestors to all your critical equipment and hope the power grid is similarly protected. If you have any warning, disconnect the equipment. Simply throwing a switch leaves a very small gap for that surge to jump, pull wires and move them far away.