I'm currently using the Powershell script below to delete all files directories and sub directories of "$dump_path" that are seven days or older based upon the creation date and not modified date.
I get the following error in the Scheduled Task history when I try to run a task:
Task Scheduler successfully completed task "\Restart Tomcat" ,
instance "{264b4620-5f3b-6c5f-a6cb-1625a7fa57de}" ,
action "C:\Windows\System32\WindowsPowerShell\v1.0\powershell.EXE"
with return code 1.
The scheduled task is configured as follows:
Name: Restart Tomcat
User: DOMAIN\tomcat.restarter
Triggers: Daily
I have a powershell script that creates a scheduled task using a call to RegisterTask via the Schedule.Service com object.
Essentially:
$ts = new-object -com Schedule.Service
$ts.Connect()
$rootfolder = $ts.GetFolder("\")
$taskXml = Get-Content "Task.xml"
$rootfolder.RegisterTask("\Maintenance", $taskXml, 6, "LOCAL SERVICE", $null, 5)
This works fine on my local machine (windows 7, and I am a
I need to backup users .pst files. The current method I am trying is making a shadow copy using Diskshadow. My script works great all but Diskshadow needs to be ran as administrator but also needs to retain the logged-on user's environment variables; specifically, the %USERNAME% and %HOMESHARE% variables so the right user’s files get copied up to the right network location.
I wrote a PowerShell script that check the executable in the < action > tag for each task in the Task directory and mark the < enabled >TRUEorFALSE< / enabled > tag as false/true depending on the validity of the digital signature of the executable.
is there a way to enable a php script (apache user) to schedule a task using the AT daemon?
I would like to pipe the task to the atd from my php script like this:
exec( "echo 'date > /some/dir/date.txt' | at now + 1 minute > /dev/null &" );
when I run the php script from the command line (root) everything is fine,
however, when I run the script via a http request the at job is never
I have a script that creates some scheduled tasks on a Windows Server 2008 R2 box using schtasks.exe, and I'd like that script to set the 'If an instance of the task is already running, run new instances in parallel' setting.
I've poked around the documentation and options for schtasks.exe (which is what I'm using to create the tasks), and don't see any way to set this setting through a script.
Is there a way to know the source and legitimacy of the tasks in the task scheduler in windows server 2008 and 2003? Can I check if the task was added by Microsoft (ie: from sccm) or by a 3rd party application?
For each task in the task scheduler, I want to verify that the task has not been created by a third party application.
We develop a web application that can be deployed on Windows or Linux. The Linux implementation uses cron, and the Windows one uses scheduled tasks to run a single PHP script that processes all scheduled tasks for our system.
The task is scheduled using schtasks during the install process, like:
This has always worked both under W2003 and W2008.