I need to have a script that will execute "system_profiler -detailLevel full" command in a remote mac machine. While this is going on, the user on the remote machine should not know that there is something happening.
I tried the following applescript:
tell application "Terminal" of machine "eppc://<ip address of remote machine>" activate do script "system_profiler -detailLevel full >> /$HOSTNAME.txt" end tell
This activates the terminal app on the desktop and hence a bad idea, as user working on that remote machine is interrupted. I want this to happen in the background.
I want a shell script (not an applescript) that will take the name of hostnames from a text file stored on the same location where the shell script is. It will then go to each host from that list of hostnames, execute the system_profiler command and copy the text file having the output of the command ($HOSTNAME.txt file) back to the machine from where the shell script was executed.
The file copying should be done without ssh,scp etc.