This is my Earrthshield macro:

/casts [target=party1target,help] Earth Shield;
/casts [target=party1,nodead] Earth Shield;
/casts Earth Shield


I'm the tank and Party1.
It puts earth shield on my target if it's friendly.
If I'm targeting an enemy, th earth shield is put on me (the tank)
if I'm dead, the earth shield is put on self of the resto shaman, of his current friendly target.

Many a time that my paladin is dead in BG like AB, yet my corpse can still target via clicks. I've often protected flags that way with 2 elementals nuking via my target, and healing/earth shield assist.