Windows Server 2008 Task Scheduler - execute job as group - windows

I want to set up some jobs in our task scheduler. Problem is that we do not want to use a user as run as user but an ant-group.
Is that possible?
I haven't found any documentation on this specific subject, some of the here say it has to be a user, others say it looks as if a group may be used.

As far as I know you can do it, by assigning a group to the task
Check this

Related

Is it possible when relaunching a job in AWX/Ansible Tower using the UI to modify extra_vars

we are using AWX/Ansible Tower to launch playbooks on hosts. In our case we are always running the playbook targeting one host each time a job is launched (actually launching the job using the API)
Our problem:
- When a job fails, we'd like to offer as an option to our users the possibility to re-launch the job with ability to change the extra_variables used to execute the job. At the moment on the UI the extra variable seems to be read-only. Is there a way to change that or another way to re-launch a job using the UI and changing the variables (we obviously know that using the API we can relaunch a new instance of the job using a new set of extra_variables...) ?
Thx

Vbscript is working fine in cmd prompt but not working in task scheduler

I have a vbscript to get the records from Oracle database and need to get those records hourly basis.
When I ran the script from cmd , script is executing fine and getting records through email but when I schedule the same script from task scheduler , showing that task completed fine but records are not getting.
Do we need any permission to access the Oracle database from task scheduler
I have logged in the server with admin user.
Is there another way to schedule this script hourly basis.
Thanks in advance
Thanks
Chandrakiran
Without some code I cannot help you much, I suspect this is an authentication issue however.
Note that the Task Scheduler does not take into account the currently logged in user when running, the script needs to authenticate itself with the database or set the "Run As" user in Task Scheduler if needed.

Create Batch File, Convert to Service, Schedule to Run Daily

I need to run an offsite backup .cmd script (batch file) on a Windows 7/8 PC, daily, whether a user is logged on or not. Naturally, Task Scheduler's feature "run if user is logged or not" doesn't work (sarcasm .. thanks M$) because the user has to be logged on at some time then signed out. Moreover, because of the urgency of the task, it must run no matter what. For example, if the power goes out and upon restoration the computer reboots, there will be nobody logged on. So, I need to convert the batch file to a service.
I've used NSSM to convert the batch file into a service, but I don't know how to make the service run on a schedule, because, by definition, it's not meant to run that way - I should be using a scheduled task. So, I'm not sure what to do and all the tutorials I've seen on Google imply that I know VB script and/or C#. Unfortunately, I don't and don't plan to ... I just need a quick fix to work like a Linux cron job.
Thanks!
Task Scheduler's feature "run if user is logged or not" doesn't work (sarcasm .. thanks M$) because the user has to be logged on at some time then signed out.
Are you sure? Because "run if user is logged or not" is an option, not a trigger. It should be combined with trigger "At startup" to achieve desired result:
If everything else fails, you can use nncron to schedule tasks and install it as service.

Windows Task Scheduler API 2.0 make task miss (only)next scheduled time

While using the Windows Task Scheduler API 2.0, how does one set or unset the option: "run task as soon as possible after a scheduled start is missed". I have already create multiple types of tasks using the API in c++, but I can't seem to find where you set this option...
I guess I found it: StartWhenAvailable .
I also would like to be able to run the task on demand within the api code.
I think I allow on demand running using: put_AllowDemandStart but how do I run it from withing the code?
I guess this is it : IRegisteredTask::Run
But... How do you make a task miss its next scheduled time?

GetProcessesByName() and Windows Server 2003 scheduled task

Does anybody know what user privileges are needed for the following code needs to successfully execute as a scheduled task on Windows Server 2003:
System.Diagnostics.Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName)
When NOT running as scheduled task i.e. under a logged in user, as long as the user is a member of "Performance Monitor Users", this code will not throw an exception.
When running as a scheduled task under the same user account, it fails.
The only way I can get it to work is to run it as a member of the Local Administrator group.
Any ideas?
My humblest apologies. The user I was using was NOT a member of "Performance Monitor Users" group.
This is necessary for .NET Framework 1.1 implementation of System.Diagnostics.
I have added the user to this group, and all is well.
What user rights assignments have you given the account that is running as a scheduled task? You'll need to give the account in question 'Log on as a batch job' in your local security settings.
Update: Does your app write to any files and if so does the scheduled task user have enough rights?
I just knocked up a test app that writes the process names from the Process[] array returned by Process.GetProcessesByName(Process.GetCurrentProcess().ProcessName) to a file and it works just fine as a scheduled task...even running under the identity of a user that is only a member of the Users group (not even a member of 'Performance Monitor Users'.
The folder it writes to is assigned modify rights to SYSTEM, Administrators and the scheduled task user.
Any chance of pasting your code or at least a small enough snippet that demonstrates the exe failing as a scheduled task so we can help diagnose the problem?
Cheers
Kev
One issue that I have seen with reading the process name is that access to the performance counters can get disabled.
Crack open your registry and see if this key is there:
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\Performance]
"Disable Performance Counters"=dword:00000001
You can either set it to zero or deleted it.
Taken from MSDN:
Permissions LinkDemand - for full
trust for the immediate caller. This
member cannot be used by partially
trusted code.

Resources