Results 1 to 7 of 7

Thread: Run batch file on remote server

  1. #1
    PeteL Guest

    Run batch file on remote server

    Overview: two servers running as cluster with the scheduled task clustered so
    if one server goes down the other will still run scheduled tasks.

    Problem: To do this the 'scheduled tasks' service is set to manual and only
    runs on the active server, if primary server fails then cluster starts
    scheduled service on secondary server once it becomes primary server. This
    means that I can't run a scheduled task to backup the system state on the
    secondary server.

    Question: Is it possible create a scheduled task on the primary server which
    will run a batch file as if it has been called from the secondary server?

    Thanks in advance, apologies for lengthy text.

    Pete.

  2. #2
    Pegasus \(MVP\) Guest

    Re: Run batch file on remote server


    "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    > Overview: two servers running as cluster with the scheduled task clustered
    > so
    > if one server goes down the other will still run scheduled tasks.
    >
    > Problem: To do this the 'scheduled tasks' service is set to manual and
    > only
    > runs on the active server, if primary server fails then cluster starts
    > scheduled service on secondary server once it becomes primary server.
    > This
    > means that I can't run a scheduled task to backup the system state on the
    > secondary server.
    >
    > Question: Is it possible create a scheduled task on the primary server
    > which
    > will run a batch file as if it has been called from the secondary server?
    >
    > Thanks in advance, apologies for lengthy text.
    >
    > Pete.


    Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    on the other server:

    net start "Task Scheduler"



  3. #3
    PeteL Guest

    Re: Run batch file on remote server

    Pegasus

    Thanks for the response.

    I ran a few tests, and the problem seems to be that the cluster takes
    control of the 'Task Scheduler' service, and will not allow it to be started
    on the secondary server. This means I get an 'access denied' message when
    trying to use PSEXEC against the secondary server as it is unable to use the
    'Task Scheduler' service. I tested this by failing the cluster over, I was
    then unable to backup the server which was giving me the 'access denied'
    message

    These tools are a great find though, thanks.

    Any other ideas greatly appreciated.

    Pete.


    "Pegasus (MVP)" wrote:

    >
    > "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    > > Overview: two servers running as cluster with the scheduled task clustered
    > > so
    > > if one server goes down the other will still run scheduled tasks.
    > >
    > > Problem: To do this the 'scheduled tasks' service is set to manual and
    > > only
    > > runs on the active server, if primary server fails then cluster starts
    > > scheduled service on secondary server once it becomes primary server.
    > > This
    > > means that I can't run a scheduled task to backup the system state on the
    > > secondary server.
    > >
    > > Question: Is it possible create a scheduled task on the primary server
    > > which
    > > will run a batch file as if it has been called from the secondary server?
    > >
    > > Thanks in advance, apologies for lengthy text.
    > >
    > > Pete.

    >
    > Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    > on the other server:
    >
    > net start "Task Scheduler"
    >
    >
    >


  4. #4
    Pegasus \(MVP\) Guest

    Re: Run batch file on remote server

    It is more likely that you used credentials that were not up to
    the job at hand. Try something like this instead:

    psexec -u PeteL -p SomePassword cmd
    net start "Task Scheduler"

    You should also execute the "net start" command while physically
    sitting in front of the server rather than at the remote machine.

    What does the Task Scheduler report about this problem?


    "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    news:50DFDF0A-DD91-4F18-972E-1771904B1F62@microsoft.com...
    > Pegasus
    >
    > Thanks for the response.
    >
    > I ran a few tests, and the problem seems to be that the cluster takes
    > control of the 'Task Scheduler' service, and will not allow it to be
    > started
    > on the secondary server. This means I get an 'access denied' message when
    > trying to use PSEXEC against the secondary server as it is unable to use
    > the
    > 'Task Scheduler' service. I tested this by failing the cluster over, I
    > was
    > then unable to backup the server which was giving me the 'access denied'
    > message
    >
    > These tools are a great find though, thanks.
    >
    > Any other ideas greatly appreciated.
    >
    > Pete.
    >
    >
    > "Pegasus (MVP)" wrote:
    >
    >>
    >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    >> news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    >> > Overview: two servers running as cluster with the scheduled task
    >> > clustered
    >> > so
    >> > if one server goes down the other will still run scheduled tasks.
    >> >
    >> > Problem: To do this the 'scheduled tasks' service is set to manual and
    >> > only
    >> > runs on the active server, if primary server fails then cluster starts
    >> > scheduled service on secondary server once it becomes primary server.
    >> > This
    >> > means that I can't run a scheduled task to backup the system state on
    >> > the
    >> > secondary server.
    >> >
    >> > Question: Is it possible create a scheduled task on the primary server
    >> > which
    >> > will run a batch file as if it has been called from the secondary
    >> > server?
    >> >
    >> > Thanks in advance, apologies for lengthy text.
    >> >
    >> > Pete.

    >>
    >> Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    >> on the other server:
    >>
    >> net start "Task Scheduler"
    >>
    >>
    >>




  5. #5
    PeteL Guest

    Re: Run batch file on remote server

    Pegasus

    Thanks for the response.

    Just to give you a bit of background; the following link shows the steps I
    followed:
    http://msmvps.com/blogs/clustering/a...3-cluster.aspx

    If I logon to the secondary server and attempt to start the 'Task Scheduler'
    I get an access denied message (logged on as administrator), If I move the
    cluster group to the secondary server the 'Task Scheduler' starts and I am
    then unable to start the 'Task Scheduler' on what was the primary server.

    This I guess makes sense from a cluster point of view or the tasks could end
    up being run from both servers at the same time.

    Thanks for your help so far.

    Pete.

    "Pegasus (MVP)" wrote:

    > It is more likely that you used credentials that were not up to
    > the job at hand. Try something like this instead:
    >
    > psexec -u PeteL -p SomePassword cmd
    > net start "Task Scheduler"
    >
    > You should also execute the "net start" command while physically
    > sitting in front of the server rather than at the remote machine.
    >
    > What does the Task Scheduler report about this problem?
    >
    >
    > "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > news:50DFDF0A-DD91-4F18-972E-1771904B1F62@microsoft.com...
    > > Pegasus
    > >
    > > Thanks for the response.
    > >
    > > I ran a few tests, and the problem seems to be that the cluster takes
    > > control of the 'Task Scheduler' service, and will not allow it to be
    > > started
    > > on the secondary server. This means I get an 'access denied' message when
    > > trying to use PSEXEC against the secondary server as it is unable to use
    > > the
    > > 'Task Scheduler' service. I tested this by failing the cluster over, I
    > > was
    > > then unable to backup the server which was giving me the 'access denied'
    > > message
    > >
    > > These tools are a great find though, thanks.
    > >
    > > Any other ideas greatly appreciated.
    > >
    > > Pete.
    > >
    > >
    > > "Pegasus (MVP)" wrote:
    > >
    > >>
    > >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > >> news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    > >> > Overview: two servers running as cluster with the scheduled task
    > >> > clustered
    > >> > so
    > >> > if one server goes down the other will still run scheduled tasks.
    > >> >
    > >> > Problem: To do this the 'scheduled tasks' service is set to manual and
    > >> > only
    > >> > runs on the active server, if primary server fails then cluster starts
    > >> > scheduled service on secondary server once it becomes primary server.
    > >> > This
    > >> > means that I can't run a scheduled task to backup the system state on
    > >> > the
    > >> > secondary server.
    > >> >
    > >> > Question: Is it possible create a scheduled task on the primary server
    > >> > which
    > >> > will run a batch file as if it has been called from the secondary
    > >> > server?
    > >> >
    > >> > Thanks in advance, apologies for lengthy text.
    > >> >
    > >> > Pete.
    > >>
    > >> Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    > >> on the other server:
    > >>
    > >> net start "Task Scheduler"
    > >>
    > >>
    > >>

    >
    >
    >


  6. #6
    Pegasus \(MVP\) Guest

    Re: Run batch file on remote server

    Sorry, I am getting way out my depth. One thing I note is that
    the the article you quote deals with the question of how to create
    a scheduled task on the active node in a cluster. It does not deal
    with the question of how to start the Task Scheduler service. Since
    I do not have a cluster to play with right now, I am unable to
    assist any further. If you really get stuck then you should ring
    Microsoft in your country and pay for a support call. The charge
    is quite moderate.


    "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    news:947DC0D4-6D33-4E01-8903-38DF08B4714C@microsoft.com...
    > Pegasus
    >
    > Thanks for the response.
    >
    > Just to give you a bit of background; the following link shows the steps I
    > followed:
    > http://msmvps.com/blogs/clustering/a...3-cluster.aspx
    >
    > If I logon to the secondary server and attempt to start the 'Task
    > Scheduler'
    > I get an access denied message (logged on as administrator), If I move the
    > cluster group to the secondary server the 'Task Scheduler' starts and I am
    > then unable to start the 'Task Scheduler' on what was the primary server.
    >
    > This I guess makes sense from a cluster point of view or the tasks could
    > end
    > up being run from both servers at the same time.
    >
    > Thanks for your help so far.
    >
    > Pete.
    >
    > "Pegasus (MVP)" wrote:
    >
    >> It is more likely that you used credentials that were not up to
    >> the job at hand. Try something like this instead:
    >>
    >> psexec -u PeteL -p SomePassword cmd
    >> net start "Task Scheduler"
    >>
    >> You should also execute the "net start" command while physically
    >> sitting in front of the server rather than at the remote machine.
    >>
    >> What does the Task Scheduler report about this problem?
    >>
    >>
    >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    >> news:50DFDF0A-DD91-4F18-972E-1771904B1F62@microsoft.com...
    >> > Pegasus
    >> >
    >> > Thanks for the response.
    >> >
    >> > I ran a few tests, and the problem seems to be that the cluster takes
    >> > control of the 'Task Scheduler' service, and will not allow it to be
    >> > started
    >> > on the secondary server. This means I get an 'access denied' message
    >> > when
    >> > trying to use PSEXEC against the secondary server as it is unable to
    >> > use
    >> > the
    >> > 'Task Scheduler' service. I tested this by failing the cluster over, I
    >> > was
    >> > then unable to backup the server which was giving me the 'access
    >> > denied'
    >> > message
    >> >
    >> > These tools are a great find though, thanks.
    >> >
    >> > Any other ideas greatly appreciated.
    >> >
    >> > Pete.
    >> >
    >> >
    >> > "Pegasus (MVP)" wrote:
    >> >
    >> >>
    >> >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    >> >> news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    >> >> > Overview: two servers running as cluster with the scheduled task
    >> >> > clustered
    >> >> > so
    >> >> > if one server goes down the other will still run scheduled tasks.
    >> >> >
    >> >> > Problem: To do this the 'scheduled tasks' service is set to manual
    >> >> > and
    >> >> > only
    >> >> > runs on the active server, if primary server fails then cluster
    >> >> > starts
    >> >> > scheduled service on secondary server once it becomes primary
    >> >> > server.
    >> >> > This
    >> >> > means that I can't run a scheduled task to backup the system state
    >> >> > on
    >> >> > the
    >> >> > secondary server.
    >> >> >
    >> >> > Question: Is it possible create a scheduled task on the primary
    >> >> > server
    >> >> > which
    >> >> > will run a batch file as if it has been called from the secondary
    >> >> > server?
    >> >> >
    >> >> > Thanks in advance, apologies for lengthy text.
    >> >> >
    >> >> > Pete.
    >> >>
    >> >> Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    >> >> on the other server:
    >> >>
    >> >> net start "Task Scheduler"
    >> >>
    >> >>
    >> >>

    >>
    >>
    >>




  7. #7
    PeteL Guest

    Re: Run batch file on remote server

    Thanks Pegasus, your time was greatly appreciated.

    Pete.

    "Pegasus (MVP)" wrote:

    > Sorry, I am getting way out my depth. One thing I note is that
    > the the article you quote deals with the question of how to create
    > a scheduled task on the active node in a cluster. It does not deal
    > with the question of how to start the Task Scheduler service. Since
    > I do not have a cluster to play with right now, I am unable to
    > assist any further. If you really get stuck then you should ring
    > Microsoft in your country and pay for a support call. The charge
    > is quite moderate.
    >
    >
    > "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > news:947DC0D4-6D33-4E01-8903-38DF08B4714C@microsoft.com...
    > > Pegasus
    > >
    > > Thanks for the response.
    > >
    > > Just to give you a bit of background; the following link shows the steps I
    > > followed:
    > > http://msmvps.com/blogs/clustering/a...3-cluster.aspx
    > >
    > > If I logon to the secondary server and attempt to start the 'Task
    > > Scheduler'
    > > I get an access denied message (logged on as administrator), If I move the
    > > cluster group to the secondary server the 'Task Scheduler' starts and I am
    > > then unable to start the 'Task Scheduler' on what was the primary server.
    > >
    > > This I guess makes sense from a cluster point of view or the tasks could
    > > end
    > > up being run from both servers at the same time.
    > >
    > > Thanks for your help so far.
    > >
    > > Pete.
    > >
    > > "Pegasus (MVP)" wrote:
    > >
    > >> It is more likely that you used credentials that were not up to
    > >> the job at hand. Try something like this instead:
    > >>
    > >> psexec -u PeteL -p SomePassword cmd
    > >> net start "Task Scheduler"
    > >>
    > >> You should also execute the "net start" command while physically
    > >> sitting in front of the server rather than at the remote machine.
    > >>
    > >> What does the Task Scheduler report about this problem?
    > >>
    > >>
    > >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > >> news:50DFDF0A-DD91-4F18-972E-1771904B1F62@microsoft.com...
    > >> > Pegasus
    > >> >
    > >> > Thanks for the response.
    > >> >
    > >> > I ran a few tests, and the problem seems to be that the cluster takes
    > >> > control of the 'Task Scheduler' service, and will not allow it to be
    > >> > started
    > >> > on the secondary server. This means I get an 'access denied' message
    > >> > when
    > >> > trying to use PSEXEC against the secondary server as it is unable to
    > >> > use
    > >> > the
    > >> > 'Task Scheduler' service. I tested this by failing the cluster over, I
    > >> > was
    > >> > then unable to backup the server which was giving me the 'access
    > >> > denied'
    > >> > message
    > >> >
    > >> > These tools are a great find though, thanks.
    > >> >
    > >> > Any other ideas greatly appreciated.
    > >> >
    > >> > Pete.
    > >> >
    > >> >
    > >> > "Pegasus (MVP)" wrote:
    > >> >
    > >> >>
    > >> >> "PeteL" <PeteL@discussions.microsoft.com> wrote in message
    > >> >> news:03BAD1B5-AF02-45B6-AC9B-AF2CA92AE35A@microsoft.com...
    > >> >> > Overview: two servers running as cluster with the scheduled task
    > >> >> > clustered
    > >> >> > so
    > >> >> > if one server goes down the other will still run scheduled tasks.
    > >> >> >
    > >> >> > Problem: To do this the 'scheduled tasks' service is set to manual
    > >> >> > and
    > >> >> > only
    > >> >> > runs on the active server, if primary server fails then cluster
    > >> >> > starts
    > >> >> > scheduled service on secondary server once it becomes primary
    > >> >> > server.
    > >> >> > This
    > >> >> > means that I can't run a scheduled task to backup the system state
    > >> >> > on
    > >> >> > the
    > >> >> > secondary server.
    > >> >> >
    > >> >> > Question: Is it possible create a scheduled task on the primary
    > >> >> > server
    > >> >> > which
    > >> >> > will run a batch file as if it has been called from the secondary
    > >> >> > server?
    > >> >> >
    > >> >> > Thanks in advance, apologies for lengthy text.
    > >> >> >
    > >> >> > Pete.
    > >> >>
    > >> >> Sure is. Use psexec.exe (www.sysinternals.com) to run this command
    > >> >> on the other server:
    > >> >>
    > >> >> net start "Task Scheduler"
    > >> >>
    > >> >>
    > >> >>
    > >>
    > >>
    > >>

    >
    >
    >


Similar Threads

  1. Running a batch file from a remote machine in a VB code
    By Radhu in forum Software Development
    Replies: 1
    Last Post: 14-10-2011, 04:54 PM
  2. Execute a batch file on a remote computer?
    By Chris D in forum Windows Server Help
    Replies: 6
    Last Post: 20-01-2011, 11:09 PM
  3. Server config file - batch editing script
    By ranjankumar09 in forum Windows Software
    Replies: 3
    Last Post: 28-01-2010, 10:30 PM
  4. Editing xml file on remote server with web service
    By spuff in forum Software Development
    Replies: 3
    Last Post: 24-09-2009, 09:01 AM
  5. Execute a batch file on remote host
    By Hulicat in forum Windows Server Help
    Replies: 5
    Last Post: 20-06-2009, 01:35 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,713,881,536.15491 seconds with 17 queries