Jump to content

Run batch file on remote server


Recommended Posts

Posted

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.

  • Replies 6
  • Created
  • Last Reply
Guest Pegasus \(MVP\)
Posted

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 (http://www.sysinternals.com) to run this command

on the other server:

 

net start "Task Scheduler"

Posted

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 (http://www.sysinternals.com) to run this command

> on the other server:

>

> net start "Task Scheduler"

>

>

>

Guest Pegasus \(MVP\)
Posted

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 (http://www.sysinternals.com) to run this command

>> on the other server:

>>

>> net start "Task Scheduler"

>>

>>

>>

Posted

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/archive/2007/05/25/how-to-create-a-scheduled-task-with-a-windows-2000-2003-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 (http://www.sysinternals.com) to run this command

> >> on the other server:

> >>

> >> net start "Task Scheduler"

> >>

> >>

> >>

>

>

>

Guest Pegasus \(MVP\)
Posted

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/archive/2007/05/25/how-to-create-a-scheduled-task-with-a-windows-2000-2003-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 (http://www.sysinternals.com) to run this command

>> >> on the other server:

>> >>

>> >> net start "Task Scheduler"

>> >>

>> >>

>> >>

>>

>>

>>

Posted

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/archive/2007/05/25/how-to-create-a-scheduled-task-with-a-windows-2000-2003-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 (http://www.sysinternals.com) to run this command

> >> >> on the other server:

> >> >>

> >> >> net start "Task Scheduler"

> >> >>

> >> >>

> >> >>

> >>

> >>

> >>

>

>

>


×
×
  • Create New...