Go Back   TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Become a Member!
Forgot your username/password?
Tags Active Topics RSS Search Mark Forums Read

Sponsored Links



Run batch file on remote server

Windows Server Help


Reply
 
Thread Tools Search this Thread
  #1  
Old 24-09-2007
PeteL
 
Posts: n/a
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.

Reply With Quote
  #2  
Old 24-09-2007
Pegasus \(MVP\)
 
Posts: n/a
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"


Reply With Quote
  #3  
Old 25-09-2007
PeteL
 
Posts: n/a
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"
>
>
>

Reply With Quote
  #4  
Old 25-09-2007
Pegasus \(MVP\)
 
Posts: n/a
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"
>>
>>
>>



Reply With Quote
  #5  
Old 25-09-2007
PeteL
 
Posts: n/a
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"
> >>
> >>
> >>

>
>
>

Reply With Quote
  #6  
Old 25-09-2007
Pegasus \(MVP\)
 
Posts: n/a
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"
>> >>
>> >>
>> >>

>>
>>
>>



Reply With Quote
  #7  
Old 25-09-2007
PeteL
 
Posts: n/a
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"
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>

>
>
>

Reply With Quote
Reply

  TechArena Community > Technical Support > Computer Help > Windows Server > Windows Server Help
Tags:



Thread Tools Search this Thread
Search this Thread:

Advanced Search


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


All times are GMT +5.5. The time now is 07:25 AM.