Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Wanet Telecoms Ltd on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

access denied when using the "at" command

Status
Not open for further replies.

bigdog92

MIS
Jan 9, 2003
87
US
H all,

I am trying to schedule a backup using the at command. My problem is that i can launch the batch file correctly and everything works fine, but if i try to use the at command i receive an access denied. I dont understand how this can be since its the same batch file that works if i launch if manually. Can anyone help?

at 04:00 "C:\TEST.BAT"

that is just a sample i didnt even put in the days to do this yet i just wanted to get it working to start.
 
well i'm running it off the copmuter i want to back up on the system admin account so i have full rights on both machines.
 
I sounds like you are trying to backup computerB buy running the At job on ComputerA as the local administrator. Well, computerA's local admin has no rights on computerB. Maybe I am just reading your post wrong!
 
i'm probally not being clear enough, let me try again. I have computer A which i am trying to run a batch file on so that it will send the files to computer a using the "at" command. The batch file runs correctly when i manually start it. However, when i try to automate it with the at command i receive an access denied reply. I hope this is a litle more clear. I have admin rights on both machines also.
 
well, if you are running the at job on computera, and as computera's local administrator, then computera's local administrator has no rights on computerb, but if you run the job on computera as a domian account whom has admin rights on both computers then you should be fine. If you are running it as comptera's local administraot then you may have to map a drive to computerb as computerb's local administraot like such:

net use \\computerb\sharename /User:computerb\administrator Password
xcopy c:\temp\*.* \\computerb\sharename\somefolder
net use \\computerb\sharename /delete /Y
 
when i said i have administrator rights i meant that i was domain admin sorry about that i was not being too clear. i have the domain admin account.
 
Well, if it is a domain admin account it surely should have all of the required rights to run this job. But just to make sure, open the local security policy\local policies\User rights assignment. Look at the rights 'logon as a service' and 'logon as a batch job'. The domain admin account you are using has to have rights to these services in order to logon as the at job.
 
oops, sorry, forgot you running NT. You should use user manger for domains and open and choose select domain and type in '\\computera'
 
i checked all that i should have sufficient rights for what you are saying but for some odd reason i get access denied.
 
No, the AT scheduler needs local admin rights to run NTBACKUP. Go to the AT service and add the local ADMIN User account for start up.

This will allow it to RUN NTBACKUP.


Joseph L. Poandl
MCSE 2000

If your company is in need of experts to examine technical problems/solutions, please check out
 
i have even mapped the drive and changed the \\computer b to a mapped drive letter, and still no dice
 
i'm not trying to run ntbackup, i'm trying to physically copy 3 specific files and that is done in the batch file if you want i will paste it in here.
 
when i said schedule a backup i was backing up 3 main files from a server through a batch file setup.

rem ** stop Microsoft Exchange Services for offline backup
REM // stop all services
echo Stopping Services...
net stop MSExchangeMSMI
net stop MSExchangePCMTA
net stop MSExchangeFB
net stop MSExchangeDX
net stop MSExchangeIMC
net stop MSExchangeMTA
net stop Microsoft Exchange Event Service
net stop MSExchangeIS
net stop MSExchangeDS
net stop MSExchangeSA

copy d:\exchsrvr\MDBDATA\Priv.edb H:
copy d:\exchsrvr\MDBDATA\Pub.edb H:
copy d:\exchsrvr\DSADATA\dir.edb H:

REM // Start all Services
echo starting services...
net start MSExchangeSA
net start MSExchangeDS
net start MSExchangeIS
net start MSExchangeMTA
net start MSExchangeIMC
net start MSExchangeDX
net start MSExchangeFB
net start MSExchangePCMTA
net start MSExchangeMSMI
net start Microsoft Exchange Event Service

pause
 
OK...

Still follow the instructions...

Give AT Scheduler DOMAIN ADMIN rights...by modifying the USERNAME that the service uses. This will allow you to run your batch file as domain admin.



Joseph L. Poandl
MCSE 2000

If your company is in need of experts to examine technical problems/solutions, please check out
 
ok so let me see if i have this syntax correct

Net Use \\computerA\ShareName Domain /user:computerB\admin pass
 
i finally got it right. net use \\computer\sharename /user:domain\username password

thanks for all your help guys!!
 
The problem with your solution is now you have a batch file with a user name and a password in clear text. This is unsecure.

Another solution would have been to give the AT schedule service the proper rights to map drives.

You see, the reason you were able to run the batch file manually is becuase you were logged into the machine with the proper user account (that had rights on all machines).

The batch file was failing when it was run by AT scheduler because the AT scheduler service did not have the proper rights to map drives.

Therefore, you could have given the AT scheduler service the proper user name and password (that can map drives). Then, your orginal batch file should have worked. Another benefit would be that your security (password) would have been hidden too.

-Just another thought. I'm glad you got it working!

Joseph L. Poandl
MCSE 2000

If your company is in need of experts to examine technical problems/solutions, please check out
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top