I've followed Tim Golden's cookbook example to schedule a job via his Python 
wmi module; however, I need to specify the user account a scheduled job gets 
executed under (i.e., the process owner).  The cookbook example will schedule a 
job owned by SYSTEM.  I note the actual WMI library provides for a User and 
Password option, which do not appear to be visible options from within the 
python wmi module's Win32_ScheduledJob call.  I am uncertain if the 
aforementioned User and Password options actually cause the scheduled job to be 
run as that user?  As a workaround I schedule my job via the Win32_ScheduledJob 
call and follow this up with a Win32_Process.Create call to "schtasks.exe", in 
which I change the job id's run user (i.e., via the /RU option) to the 
appropriate user name.

Is there a way I can specify the run (or execution) user of a scheduled job 
within the Win32_ScheduledJob call or via the wmi interface?  The way I am 
doing it right now, I could have simply called schtasks.exe directly and had it 
create the process with the intended run user, which I don't find very eloquent.

Tom
_______________________________________________
python-win32 mailing list
python-win32@python.org
http://mail.python.org/mailman/listinfo/python-win32

Reply via email to