Table of Contents | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
Problem Scenario
- User configured
...
- a job to execute a simple Windows command to copy a file from folderA to folderB.
...
- The source directory is a local directory but the target directory is a shared drive/Samba mount on a Windows server.
- The user reported that when he
...
- tries to execute the same command from the CMD prompt he has no problem,
...
- but the same command when configured to run from JobScheduler throws an "Access denied" error.
...
JobScheduler example Job
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" encoding="ISO-8859-1"?> <job > <script language="shell"> <![CDATA[ copy c:/outbound/test.txt d:\reports\daily ]]> </script> <run_time /> </job> |
JobScheduler runs as a Service on a Windows Server, . The Windows Service has a special user is assigned a service User which may or may not have the same right permissions as the user logedinwho loged in/installed the JobScheduler, even administrator user.
To see what user right permissions JobScheduler is running with , user can you could execute the command whoami /all on the CMD prompt and also insert add the same command to JobScheduler in JobScheduler Joba job.
One can compare User Rights given to Starting from this you could compare the user permissions assigned to the Windows Service user and Admin userto the user from the CMD prompt and from the JobScheduler job log.
JobScheduler example Job with
...
whoami /all command
...
Code Block | ||
---|---|---|
| ||
<?xml version="1.0" |
...
encoding="ISO-8859-1"?> |
...
<job > |
...
No Format |
---|
<script language="shell"> <\![CDATA[ whoami /all copy c:/outbound/test.txt d:\reports\daily ]]> </script> <run_time /> |
...
</job> |