From: Paco on 16 Jun 2010 02:40 Hi! I'm having a problem with schedule tasks on a windows 2003 r2 sp2 server. I have made a batch file name bat.bat and put the simple code of 'xcopy bat.bat bat.bak' This batch file I'm putting on another server \\srv2\share\ While logged on to the server as a domain admin ex DA1 I can set up the scheduled task \\srv2\share\bat.bat and if the user credentials is DA1 I can run the task and it works just fine. But if I am still logged on to the server with DA1 and tries to run the same task with another user, even if this user also is a domain admin ex DA2 the task does not run I have tried to add both DA2 and batch to the security to cmd and I have also given them full ntfs rights to the shared catalog. But nothing helps, what am I missing? or must I run the tasks as the person logged onto the server?
From: Paco on 16 Jun 2010 03:01 Pardon a newbie but how do I delete the dubble posts?
From: Pegasus [MVP] on 16 Jun 2010 04:20 "Paco" <Paco(a)discussions.microsoft.com> wrote in message news:6B03C0BB-6B6E-49FD-91AC-32E25AD9521D(a)microsoft.com... > Hi! > I'm having a problem with schedule tasks on a windows 2003 r2 sp2 server. > > I have made a batch file name bat.bat and put the simple code of 'xcopy > bat.bat bat.bak' > This batch file I'm putting on another server \\srv2\share\ > > While logged on to the server as a domain admin ex DA1 I can set up the > scheduled task \\srv2\share\bat.bat and if the user credentials is DA1 I > can > run the task and it works just fine. > > But if I am still logged on to the server with DA1 and tries to run the > same > task with another user, even if this user also is a domain admin ex DA2 > the > task does not run > I have tried to add both DA2 and batch to the security to cmd and I have > also given them full ntfs rights to the shared catalog. > But nothing helps, what am I missing? or must I run the tasks as the > person > logged onto the server? Modify your batch file as below, then determine if the task really does not run. I suspect it does. Note that the account used to run the batch file must have read/write access to C:\. @echo off echo %date% %time% %Username% >> c:\schedule.txt About your multiple posts: When they are posted they remain posted. You cannot recall them.
From: Paco on 16 Jun 2010 06:20 Hi and thank you for your help. The account has domain admin rights so it can access/write to all the servers I added the line to the bat.bat file. Which is on srv2 I executed the task on srv1. The text file and information was created on srv1 c:\ as you said it would. So to test it further I added the line echo %date% %time% %Username% >> \\srv2\Dokument\IT\CasaWin\schedule.txt And this worked also. Why doesn't the other xcopy line work? I even changed it to xcopy \\srv2\Dokument\IT\CasaWin\bat.bat \\srv2\Dokument\IT\CasaWin\bat.bak "Pegasus [MVP]" wrote: > > Modify your batch file as below, then determine if the task really does not > run. I suspect it does. Note that the account used to run the batch file > must have read/write access to C:\. > > @echo off > echo %date% %time% %Username% >> c:\schedule.txt > > About your multiple posts: When they are posted they remain posted. You > cannot recall them. > > . >
From: Pegasus [MVP] on 16 Jun 2010 08:56 "Paco" <Paco(a)discussions.microsoft.com> wrote in message news:FC703803-9F04-4DB2-A4CF-C8CDAB043178(a)microsoft.com... > Hi and thank you for your help. > > The account has domain admin rights so it can access/write to all the > servers > I added the line to the bat.bat file. Which is on srv2 > I executed the task on srv1. > The text file and information was created on srv1 c:\ as you said it > would. > > So to test it further I added the line echo %date% %time% %Username% >> > \\srv2\Dokument\IT\CasaWin\schedule.txt > And this worked also. > > Why doesn't the other xcopy line work? > I even changed it to xcopy \\srv2\Dokument\IT\CasaWin\bat.bat > \\srv2\Dokument\IT\CasaWin\bat.bak With scheduled tasks the trick is to give yourself eyes. Initially you thought that the task would not run. By scheduling a very simple batch file and logging its output (first set of eyes!) you found that it does run. You now think that xcopy does not work. Let's add another set of eyes like so: @echo off echo %date% %time% %Username% >> c:\schedule.txt xcopy . . . . . . 1>>c:\schedule.txt 2>>&1 Chances are that the log file will tell you everything you need to know. If things are still unclear then you should post the exact command you use (which, as a matter of fact, would have been a good idea for your very first post).
|
Next
|
Last
Pages: 1 2 Prev: How to change Machine name without Prompt for credentials Next: Schedule Tasks |