Running python script in schedule task server 2008R2

Posted on 2013-12-02
Medium Priority
Last Modified: 2013-12-14

Task to run python script to delete files from a CIFS share is being executed with following settings:

- Task running as domain admin account which has full permissions wherever needed.
- Task setting of "Run with highest proviliges" is checked.
- Task action: Program/script:  c:\scripts\python\python.exe
                       Add arguments: c:\scripts\python\script.py

the task is working just fine as long as the setting of: "Run only when user is logged on" is checked.

when changing to: "Run whether user is logged on or not" which is what I actually need and entering the correct credentials of the SAME user which is currently logged on to the server, the task does not run, and in the "Last run result" is shows: (0x1) .

the script deletes files in a mapped drive which is mapped to a CIFS share.

Any ideas ?
Question by:iNc0g
  • 2
LVL 14

Accepted Solution

BlueCompute earned 1200 total points
ID: 39700980
What happens if you create another Domain Admin account and run under its credentials?

What happens if you run the job using a batch file to call python and the script?
LVL 25

Expert Comment

ID: 39703495
Personally, I would add some logging to the python script to figure out how far it's getting and where it's failing.  Can you post your script?

Assisted Solution

iNc0g earned 0 total points
ID: 39706356
I eventually tried again to schedule the job using a batch file instead of directly approaching the python.exe , it worked this time as long as I used:
start c:\python27\python.exe c:\scripts\script.py  in the batch file instead of just:
c:\python27\python.exe c:\scripts\script.py

thanks for the help.

Author Closing Comment

ID: 39718507
combo of the 2

Featured Post

A proven path to a career in data science

At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science  with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
A procedure for exporting installed hotfix details of remote computers using powershell
This tutorial will give a an overview on how to deploy remote agents in Backup Exec 2012 to new servers. Click on the Backup Exec button in the upper left corner. From here, are global settings for the application such as connecting to a remote Back…
This tutorial will walk an individual through configuring a drive on a Windows Server 2008 to perform shadow copies in order to quickly recover deleted files and folders. Click on Start and then select Computer to view the available drives on the se…

600 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question