25112
asked on
push same scheduled task across multiple servers?
we have 12 servers and same scheduled task is needed on them all.. (powershell script).. is there a easy way to push the deployment on that many servers from one central location.. (they are all on the same domain).
pl advice.
pl advice.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
OK- thanks.
I can run this for all 12 servers, from the 1st server:
schtasks /create /s hostname3 /tn "Daily Run" /tr c:\scripts\myscript.bat /sc DAILY /st 05:00:00 /sd 01/20/2016
*is there a way to push
c:\scripts\myscript.bat
file to 12 servers also, as part of server?
I can run this for all 12 servers, from the 1st server:
schtasks /create /s hostname3 /tn "Daily Run" /tr c:\scripts\myscript.bat /sc DAILY /st 05:00:00 /sd 01/20/2016
*is there a way to push
c:\scripts\myscript.bat
file to 12 servers also, as part of server?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thanks.. the code works.. now I went to one of the server, but don't see it in Task Scheduler.. which folder will be it placed under, by default?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
2008R2->2008R2
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
lionel, when I run
schtasks.exe
a cmd prompt black screen comes up, runs something and disappears.. nothing else happens..
can you tell me how you bought the [main default folder] that you referred?
schtasks.exe
a cmd prompt black screen comes up, runs something and disappears.. nothing else happens..
can you tell me how you bought the [main default folder] that you referred?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
hi lionelmm,
when I run
start cmd first, then run schtasks
no, the command prompt is gone..
I did this..
C:\Users\chet>schtasks >G:\test.txt
so I can see what it ran.. please see attached.. (but the cmd screen stays only when I did the above way.. when I just put schtasks, it just blinks and disappears..
test.txt
when I run
start cmd first, then run schtasks
no, the command prompt is gone..
I did this..
C:\Users\chet>schtasks >G:\test.txt
so I can see what it ran.. please see attached.. (but the cmd screen stays only when I did the above way.. when I just put schtasks, it just blinks and disappears..
test.txt
are you running the original command from an elevated command prompt? if not try it that way and see if it shows up then.
ASKER
schtasks is suitable for this environment..
will I be running these statements below one by one, from machine1?
what about windows login when password is forced to change in a few weeks?
can you suggest changing below daily for 5am.
~~~
schtasks /create /s hostname1 /tn "Weekly Run" /tr c:\scripts\myscript.bat /sc weekly /D SUN /st 07:00:00 /sd 01/20/2016 /ru "domain\admin" /rp "password"
schtasks /create /s hostname2 /tn "Weekly Run" /tr c:\scripts\myscript.bat /sc weekly /D SUN /st 07:00:00 /sd 01/20/2016 /ru "domain\admin" /rp "password"
schtasks /create /s hostname3 /tn "Weekly Run" /tr c:\scripts\myscript.bat /sc weekly /D SUN /st 07:00:00 /sd 01/20/2016 /ru "domain\admin" /rp "password"