I need some help trying to come up with the proper command for this.
I have a long list of servers, which I need to create a task on for each to archive their event logs. I've created a vbscript to do the actual archiving, but now need to hook it up with the Task Scheduler. The code I have so far is:
psexec \\computer1 -u domain/Admin -p Passwd schtasks /create /tn "ArchiveLog" /tr "c:/task/ArchiveLog.vbs" \\T:3600 /sc DAILY /ru MYDOMAIN/backmeup /rp Password
This creates a task successfully, but it is still not configured the way I want it to be. Doing it this way, when you open the task properties, it ends up looking like picture 1. I want it to look like picture 2. How do you modify the command above so that it looks like Picture 2?
The reason being is that vbs on all the machines (for security reasons) is configured to not automatically run (it actually executes as a text file) - so I need to attach the cscript.exe along with the vbs file to make sure it actually runs properly..
run this: cscript ArchiveLog.vbs
instead of just this: ArchiveLog.vbs