Running script on remote machine

if i have a script in my system which i need to run on remote system using ssh, how shall i do it?

One easy way to to first scp it to remote machine and then run it on remote machine using ssh.

Is there any one step way to do it. Preferably one in which i should give password only once

Look into expect. An expect script will allow you to connect to a box and run whatever commands you need to run, just as if you were typing them.
It'd look something like:

 #!/usr/local/bin/expect --
spawn ssh [lindex $argv 0]
expect Password:
send "[lindex $argv 1]\r"
expect #
send "do this command\r"
expect # 
send exit\r
expect #

exit 0

... and you could call it from the command line (or cron, or another script) like

 myexpectscript hostname password 

Problem is "expect" is not a standard command and is not bundled with all solaris version. Is there any other way?

I guess it could depend on whether Your script is interactive, and whether You are picky about screen output, but You can try running Your sequence of commands (from a file, without a shebang) by feeding them to ssh like this,

ssh user@host < commands

or even on the same line

ssh user@host "ls;date;ps"

if it's not too long...

Try experimenting with that.

/Lakris