Problem Scenario
User configured Job to execute simple Windows command to copy file from folderA to folderB. User reported that when he try to execute same command from CMD prompt he has no problem,
but same command when configured to run from JobScheduler throws "Access denied" error. Source directory is local directory but target directory is an shared drive/Samba mount on Windows server.
JobScheduler example Job
?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 Service on Windows Server, Windows Service has a special user which may or may not have same right as user logedin/installed the JobScheduler, even administrator user.
To see what user right JobScheduler is running with , user can execute command whoami /all on CMD prompt and also insert same command in JobScheduler Job.
One can compare User Rights given to Windows Service user and Admin user.
JobScheduler example Job with whoali /all command
<syntaxhighlight lanh1. "xml">
?xml version"1.0" encodinh1. "ISO-8859-1"?>
<job >
<script language"shell"> <\![CDATA[whoami /all copy c:/outbound/test.txt d:\reports\daily]]> </script>
<run_time />
</job>