?
Solved

Scheduling remotet tasks

Posted on 2006-07-10
5
Medium Priority
?
296 Views
Last Modified: 2012-05-05
I support servers across the country and have a few processes that allow me
to execute tasks on all the servers using scheduled tasks. A script runs
through a server OU and creates a CMD file that looks like this....  (
simplified )

    at \\server1 4:00 d:\utils\process.cmd
    at \\server2 4:00 d:\utils\process.cmd
    at \\server3 4:00 d:\utils\process.cmd
    at \\server4 4:00 d:\utils\process.cmd
    ..
    ..

Executing this CMD file then schedules process.cmd to run on all servers at 4:00 AM.

There is one process in particular that I would like to have run at the same
time on all servers, but when the tasks are scheduled using the AT command
as seen above, the task runs on local time. Since my servers span the
country, several time zones are crossed.

Is there a way using AT or SCHTASKS that tasks can be scheduled to run at the same time (GMT) even though they cross time zones?

A simple "NO" answer gets you 50 points.
A "YES" and help to solve this will earn between 125 and 250 depending on the difficulty.



0
Comment
Question by:Sevy0622
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
5 Comments
 
LVL 33

Expert Comment

by:NJComputerNetworks
ID: 17073661
no, I think you will have to script custom kick off times... You can either manually organize your servers into time zone and edit the script for the proper kick off time, or device a mechanism to check the system time zone before running the AT.
0
 
LVL 1

Accepted Solution

by:
cbeee earned 375 total points
ID: 17074222
you could use psexec within a batch file to run all the at commands at the same time.  psexec is a free tool which comes with other useful tools and is packaged as 'pstools'.
0
 

Author Comment

by:Sevy0622
ID: 17167895
Raising the point value for solution
0
 

Author Comment

by:Sevy0622
ID: 17167996
This worked with a little engineering.

Using psexec like
     psexec @DCList.txt \\rmtserver\rmtshare\script.cmd
will execute the script on all the servers, however, the process runs through the list of DCs in the text file, running the script against each server consecutively. This gets the script run on all servers, but when I have about 60 DCs in the list, and the process runs between 2-3 minutes on each server, that makes for a two to three hours time difference for the execution on the first and last servers.

...so...

I modified my script to create the CMD file....
     psexec \\server1 \\rmtserver\rmtshare\script.cmd
     psexec \\server2 \\rmtserver\rmtshare\script.cmd
     psexec \\server3 \\rmtserver\rmtshare\script.cmd
     ..

Thanks for your help!!!
     ..
So when I execute my CMD file, the script gets remotely launched on all DCs at the same time.

0
 

Author Comment

by:Sevy0622
ID: 17168034
FYI ...   Below is a script which I received to this question  from a news group. It uses a method where you determine the time zone offset for each server and adjust the execution time for the AT command. This is very interesting and something I will spend some time working with too.


    Save the following as sGMT.bat:

    @echo off
    if {%4}=={} @echo Syntax: Call sGMT \\Server GMT_Hour_2_Schedule GMT_Minute_2_Schedule FQFN&goto :EOF
    setlocal
    set key=%1\HKLM\System\CurrentControlSet\Control\TimeZoneInformation
    for /f "Tokens=3" %%a in ('reg query %key% /V ActiveTimeBias^|FIND "REG_DWORD"') do (
       set /a off=%%a
    )
    if %off% GEQ 0 goto pos
    set /a off=0 - %off%
    set /a oh=%off% / 60
    set /a om=%off% - (%oh% * 60)
    set /a oh=24 - %oh%
    set /a sh=%2 + %oh%
    set /a sm=%3 + %om%
    if %om% NEQ 0 set /a sh=%sh% - 1
    goto :OK
    :pos
    set /a oh=%off% / 60
    set /a om=%off% - (%oh% * 60)
    set /a sh=%2 + %oh%
    set /a sm=%3 + %om%
    :OK
    if %sm% LSS 10 set sm=0%sm%
    AT %1 %sh%:%sm% %4

Then, in your batch

    call sGMT \\server1 4 0 d:\utils\process.cmd
    call sGMT \\server2 4 0 d:\utils\process.cmd
    call sGMT \\server3 4 0 d:\utils\process.cmd
    call sGMT \\server4 4 0 d:\utils\process.cmd

0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Batuhan Cetin Within the dynamic life of an IT administrator, we hold many information in our minds like user names, passwords, IDs, phone numbers, incomes, service tags, bills and the order from our wives to buy milk when coming back to home.…
Setting up a Microsoft WSUS update system is free relatively speaking if you have hard disk space and processor capacity.   However, WSUS can be a blessing and a curse. For example, there is nothing worse than approving updates and they just have…
Monitoring a network: how to monitor network services and why? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the philosophy behind service monitoring and why a handshake validation is critical in network monitoring. Software utilized …
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question