Remote Start of VBS between two servers.

Niranjan Venkatesh
Niranjan Venkatesh used Ask the Experts™
on
Hi Folks,

I am going to explain my issue and hope i can get an easy answer!

I have a two domain's with Two Dc on each ,  one is running Windows Server 2008 R2 and the other Windows Server 2008, both 64 bit . I have written a VBS to create backups of the data . The script creates a backup of the data onto the secondary DC, then creates a zip file named with the date and time on an external backup Hard drive. I also use the same script on the secondary Dc to create a zip file for daily offsite storage.

The scripts are doing the job perfectly , the logic and all other factors are great. Currently the primary Dc gives message to let the user know the files have been copied to the Secondary dc, and the user can then double click the script on the Secondary dc to begin zipping the files onto the offsite HDD.
My problem is that i actually want the script running on the primary DC to start the backup script on the secondary Dc automatically with out asking the user to do so. The zipping process has a command window to show its progress and on completion the servers are shutdown each day.

Any ideas and suggestion on this problem would be appreciated.

Regards,
Niranjan
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Commented:
If your LAN connection between the DC's is decent you could just share and write to the external drive from the first server if that is all the script does?

Or you could have your script running all the time but look for a "flag" file that DC drops.

You could also use PSEXEC to run your VBS on the remote machine, or set a scheduled task to run on there, something like this for starters, look through schtasks /create /? for more info.

schtasks /create /s DC2 /RU SYSTEM /SG ONCE /TN BACKUP /TR "c:\windows\system32\cscript.exe //nologo C:\yourvbsdir\vbsfile.vbs"

Author

Commented:
Hi

The LAN connections are very decent (1GBPS) so that is not an issue. I think i did not make it very clear(sorry it was late, and I was tired and stressed as a server I am building was giving me grief!) In total there is three backups being made, one on the Secondary DC, one on the External HDD attached to the Primary DC and another External HDD  on the Secondary DC   which is   my off  site backup.
 
I did try Psexec,  but on the second dc the file pops up a window and nothing seem to happen as i think it is related  to the window that Winzip Cli opens.

I will try the schtasks idea over this weekend and revert by Monday.

Regards,
Niranjan
Commented:
aside from scheduling a job each time if it is not time critical personally I think I would schedule a task to run hourly each day, or at certain times on 'dc2' that looks for the file and does its stuff.

Likewise as the connections is good, depending upon transfer time then just use copy / xcopy / robocopy to send the file to \\dc2\backupdrive or whatever...
Using dragon-its suggestion, here is my answer,

1) I put the VBS on DC2, and created a task to run as an administrator on the machine once.
2) I then use schtask /Run with the User name /password and Task name to run the vbs immediately when required.

Thank to Dragon-it for the suggestion.

Author

Commented:
My main issue was to running the VBS on DC2 as soon as Dc1 finished copying the files to it. So this solution works well, as i dont have to worry about scheduling , setting times etc.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial