rsh is not secure, doing this via script means storing the password of the respective server in file, plus using "expect / TCL" to achieve this, we had few similar threads here. Depending on what flavor of UNIX is being used, you may search for special software for managing large number of servers, or, setup passwordless authentication via ssh keys.