I like Jochen's method.

Quick clean code.

You could also use SELECT CASE statements for determination. That way you could chose which portion (if any) of the script you do want to run on any specific server and bail out on the others.