We have been working hard on a new remote execution engine for Network Administrator
It really is a difficult problem to tackle with Windows 7, Vista, and 2008 in the mix. UAC, and other security features make it nearly impossible get something like this to work properly – but we have come up with some elegant solutions.
The execution engine is almost complete, but we still have some work to do before we can get it inside the latest version of Network Administrator
Why not create a free tool from this code?
What a great idea! – That is exactly what we did, and it is called ‘Remote Execute’
It allows you to take a program, and execute it remotely on any Windows 2000, XP, 2003, Windows 7, Windows 2008, or Vista machine on your network.
What makes this free tool so special? Here are some situations that it covers:
-Execute a process as the user sitting in front of the machine, not the administrator. Got a script you want to run on a machine, but as the current user? This can do the trick
-Execute in any console or remote desktop session that matches a wildcard filter. Need to run a program in Dave’s session on the terminal server? No problem
-Access to the standard input and output of the process on the remote machine. Want to have a remote command line? Remote Execute can do it.
-Mike is at the reception desk and needs a setup program launched as administrator. No need to go to his computer, just execute it as an admin in the console session. No UAC prompts either, it will be automatically elevated.
-Jennifer in accounting needs a drive mapped. Don’t want to interrupt her by remoting into her machine? Remote Execute can connect you to a command prompt that is run under Jennifer’s account. Just run the network mapping commands from your workstation and she is all set.
-Automatic detection of VBS and BAT files, so you don’t have to create a funky command line to get it to work.
Here are the command line options for Remote Execute:
RemoteExecute.exe -h [host] -u [user] -p [pass] [options] [filename] [arguments]
-h The remote host name or IP
-u Username *
-p Password *
-e Don't load users environment variables
-l Don't load users profile
-c Copy file to the remote host
-cs Run process in the console session
-n Run process as hidden
-sf [filter] Run in session where [filter] matches the user
-i Return immediately, and don't wait for it to terminate
-sa Run process under the system account
-su Run process as the session user
* - Required options
Lets start out with a simple one. You want to get a remote command line on a remote Windows 2000 machine with the IP address 10.10.10.146. What are the options to do this?
RemoteExecute.exe -h 10.10.10.146 -u administrator -p password %systemroot%\System32\cmd.exe
See, Now on my Windows 7 machine it drops down to that remote computer’s command prompt:
If you wanted to run a script as the current console user, it would look like this:
RemoteExecute.exe -su -cs -h 10.10.10.146 -u administrator -p password c:\temp\test.vbs
These two options are what enabled this to happen:
-su – Tells it to run as the current session user instead of you
-cs – Tells it to execute the application in the console session
If you wanted to copy that c:\temp\test.vbs over to the remote host, just add the -c option like this:
RemoteExecute.exe -c -su -cs -h 10.10.10.146 -u administrator -p password c:\temp\test.vbs
What about that terminal server? Lets say you have a user named mike logged into that server and want to run a script that remaps all his printers.
The command line would look like this:
RemoteExecute.exe -su -sf mike -h 10.10.10.146 -u administrator -p password c:\Code\ReMapPrn.bat
-su – This option tells it to run as mike, not the administrator. This will allow our printer mapping to directly affect his account
-sf – This is the session filter. It tells it to find the first account matching the name ‘mike’
The session filter argument can also take DOS style wildcards:
RemoteExecute.exe -sf admin* -su -h 10.10.10.146 -u administrator -p password c:\Code\BigScript.bat
Just keep in mind it will only execute on the first session that matches the wildcard.
What if you have a batch file on your local machine that you want to have copied over to the remote machine?
Just use the -c option, and it will copy the file and automatically take care of the rest:
RemoteExecute.exe -c -h 10.10.10.146 -u administrator -p password c:\Code\BigScript.bat
Make sure you always put your options first. The file you are going to execute, and its arguments always go last.
There are lots of options packed in this tool. Most of its functionality and more will be in the next release of Network Administrator, and all current customers will get this as a free update when it comes out. Buy it before the release (Towards the end of June) and get 25% off the usual price. Use the code INTE40 when ordering.
This is the first release, so please let us know if you are having trouble getting it to run a program remotely. We have tested it on every major version of Windows, but there could always be a combination of service packs and Windows version that could cause an issue. Just send an email to firstname.lastname@example.org and we will get back to you asap.
Get Remote Execute from our download section
Oh – and I almost forgot. This requires file and printer sharing. Here are links on how to open this up on all major versions of Windows:
Windows Vista, 2008:
Windows 7, 2008 R2:
As always, these freebies are free for commercial and personal use.