Running scheduled tasks even if their time is missed?

Hi
I have some tasks (e.g. iSync-ing to my mobile phone) which I need to schedule periodically, but would like them to run (albeit in a delay) if my Mac happens to be off at the time of their scheduled run.
Both cron and launchd jobs seem to ignore a job that is overdue and hasn't been run.
Is there some tool or workaround that can run missed jobs as soon as the Mac wakes up or goes online (if the job requires internet access)?
Thanks

Hey pooleking,
I'd start the troubleshooting with your iPod. You can find some basic steps to start with here:
iPod troubleshooting basics and service FAQ
http://support.apple.com/kb/TS1382
Take care,
David

Similar Messages

  • List all running scheduled tasks on local/remote machine

    Hi All,
    I'm in need of a PS script, which can list all the active/running scheduled tasks either on local or remote machine.
    Please share if you have one readily available.
    Thanks in advance!!!
    Pavan

    Hi Pavan,
    Have you checked the script repository? That's a good place to find prewritten scripts:
    http://gallery.technet.microsoft.com/scriptcenter
    Don't retire TechNet! -
    (Don't give up yet - 13,085+ strong and growing)

  • Run Scheduled Tasks with MSA on 2008R2

    Is it actually possible for a scheduled ask to under with an sMSA as opposed to a gMSA?
    I have created an sMSA, added it to a server computer running 2008R2 and installed the sMSA. Now running the command
    schtasks /CHange /TN taskName /RU
    sMSA_Name$ /RP ""
    gives error : Logon Failure: unknown username or bad password
    Any ideas? Thanks!!

    Hi,
    Based on my research, Standalone Managed Service Account can only be used to run services, but not to be used to run scheduled tasks on Windows Server 2008 R2.
    More information for you:
    Using Standalone Managed Service Accounts for Scheduled Tasks
    http://blog.simonw.se/using_standalone_managed_service_accounts_for_scheduled_tasks/
    Best Regards,
    Amy
    Please remember to mark the replies as answers if they help and un-mark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact [email protected]

  • Security Violation Error while running schedule task from OIM.

    Hi All,
    I am getting this error while running a custom java schedule task from OIM:
    *Thor.API.Exceptions.tcAPIException [EJB:010160] Security Violation: User '<anonymous>' has insufficient permission to access EJB:*
    type=<ejb>,application=Xellerate,module=xlDataObjectBeans.jar,ejb=tcReconciliationoperations,method=createDeleteReconciliationEvent
    at Thor.API.Operations.tcReconciliationOperationsClient.createDeleteReconciliationEvent(UnKnown Source).
    I got this error as soon as my code start creating Delete Reconciliation Event.
    Note: I have already protected the JNDI Namespace.
    Please provide some pointers.
    Regards,
    Sunny

    Hi Rajiv,
    Check this:
    package com.centrica.iam.scheduletask;
    import java.io.BufferedReader;
    import java.io.File;
    import java.io.FileFilter;
    import java.io.FileNotFoundException;
    import java.io.FileReader;
    import java.text.SimpleDateFormat;
    import java.util.ArrayList;
    import java.util.Calendar;
    import java.util.Date;
    import java.util.HashMap;
    import java.util.Hashtable;
    import java.util.Iterator;
    import java.util.Set;
    import oracle.iam.connectors.common.ConnectorLogger;
    import com.thortech.xl.dataaccess.tcDataSet;
    import com.thortech.xl.dataaccess.tcDataSetException;
    import com.thortech.xl.dataobj.PreparedStatementUtil;
    import com.thortech.xl.orb.dataaccess.tcDataAccessException;
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    import Thor.API.tcResultSet;
    import Thor.API.Exceptions.tcAPIException;
    import Thor.API.Exceptions.tcInvalidValueException;
    import Thor.API.Operations.tcLookupOperationsIntf;
    import Thor.API.Operations.tcReconciliationOperationsIntf;
    import Thor.API.Operations.tcSchedulerOperationsIntf;
    public class CustomFlatFile extends SchedulerBaseTask {
         private static tcSchedulerOperationsIntf schedulerIntf;
         private static tcLookupOperationsIntf lookupIntf;
         private static tcReconciliationOperationsIntf reconIntf;
         String sObjectName;
         String LookupName;
         String LookupName2;
         String FileDirectory;
         String FileName;
         String File;
         String delimeter;
         String isDeleteTrue;
         HashMap<String, String> attrMap = new HashMap();
         HashMap<String, String> delMap = new HashMap();
         HashMap<String, String> finalMap = new HashMap();
         ArrayList list = new ArrayList();
         public boolean isReconStopped;
         public CustomFlatFile()
              isReconStopped = false;
         public void init()
              LookupName = getAttribute("Attribute Lookup Name");
              FileDirectory = getAttribute("Directory Path");
              FileName = getAttribute("File Name");
              delimeter = getAttribute("Delimeter");
              sObjectName = getAttribute("Resource Object Name");
              isDeleteTrue = getAttribute("Is Delete Allowed");
         public void execute(){
              try {
                   System.out.println("Start Exceute");
                   //Initiate lookupIntf
                   lookupIntf = (tcLookupOperationsIntf)getUtility("Thor.API.Operations.tcLookupOperationsIntf");
                   reconIntf=(tcReconciliationOperationsIntf)getUtility("Thor.API.Operations.tcReconciliationOperationsIntf");
                   catch (tcAPIException tcapiexception){
                        tcapiexception.printStackTrace();
                        //logger.error(classname, s, tcapiexception.toString());
                        //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
                   catch (Exception excep){
                        excep.printStackTrace();
                        //logger.error(classname, s, excep.toString());
                        //logger.setStackTrace(excep, classname, s, excep.getMessage());
                   attrMap = readLookup(LookupName);
                   System.out.println(attrMap.toString());
                   readFile();
                   if (isDeleteTrue.equalsIgnoreCase("true"))
                        performDelete();
                   System.out.println("Finish Execute");
         public void performDelete()
              System.out.println("Start Perform delete");
              int k = list.size();
              System.out.println("list size " + list.size());
              try
                   Thread.sleep(15000);
         /*     Hashtable ahashtable[] = new Hashtable[k];
              Hashtable hashtable = new Hashtable();
              for (int i=0;i<k;i++)
                   hashtable.put("User Id", list.get(i));
                   ahashtable[i] = hashtable;
                   System.out.println(list.get(i));
              Set set = reconIntf.provideDeletionDetectionData(sObjectName, ahashtable);
              System.out.println("Set--" + set.toString());
              tcResultSet tcresultset = reconIntf.getMissingAccounts(sObjectName, set);
              System.out.println("tcresultset - " + tcresultset.getRowCount());
              if (!(tcresultset.isEmpty()))
                   long l[] = reconIntf.deleteDetectedAccounts(tcresultset);
                   for (int i1=0;i1<l.length;i1++)
                        System.out.println("delete recon key " + l[i1]);
              //Get the existing list of Managed users
                   tcDataSet tcdataset = new tcDataSet();
                   tcDataSet tcdataset1 = new tcDataSet();
                   String query = "select orf.orf_fieldname,prf.prf_columnname, sdk.sdk_name from orf, sdk, pkg, tos, prf, obj " +
                             "where pkg.obj_key = obj.obj_key and pkg.pkg_key = tos.pkg_key and tos.sdk_key is not null " +
                             "and tos.sdk_key=sdk.sdk_key and tos.tos_key=prf.tos_key and prf.prf_iskey='1' and prf.orf_key=orf.orf_key " +
                             "and orf.orf_parent_orf_key is null and obj.obj_name='" + sObjectName + "'";
                   tcdataset.setQuery(getDataBase(), query);
                   tcdataset.executeQuery();
                   String FFName = tcdataset.getString("prf_columnname");
                   String FName = tcdataset.getString("sdk_name");
                   String ROFName = tcdataset.getString("orf_fieldname");
                   System.out.println("form- " + FName + " Field- " + FFName);
                   query = "select " + FFName + " from " + FName + " udtable, oiu a, ost b " +
                             "where udtable.orc_key=a.orc_key and a.ost_key=b.ost_key and b.ost_status!='Revoked'";
                   System.out.println(query);
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   int i = tcdataset1.getRowCount();
                   ArrayList list1 = new ArrayList();
                   String s1 = null;
                   System.out.println("N. of rows--" + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   //Getting the existing list of unmanaged users
                   query = "select distinct (b.rcd_value) from rce a, rcd b, orf c, obj d where a.rce_key=b.rce_key and " +
                             "b.orf_key=c.orf_key and c.orf_fieldname='" + ROFName + "' and a.rce_status!='Event Linked' " +
                                       "and a.obj_key = d.obj_key and d.obj_name='" + sObjectName + "'";
                   tcdataset1.setQuery(getDataBase(), query);
                   tcdataset1.executeQuery();
                   i = tcdataset1.getRowCount();
                   System.out.println("No. Of Unmanaged Users " + i);
                   for (int j=0;j<i;j++)
                        tcdataset1.goToRow(j);
                        s1 = tcdataset1.getString(0);
                        System.out.println("s1---" + s1);
                        if (!(list.contains(s1)))
                             list1.add(s1);
                             System.out.println("under if--" + s1);
                   int k1 = list1.size();
                   System.out.println("list1 size--" + k1);
                   for (int j1=0;j1<k1;j1++)
                        delMap.clear();
                        delMap.put(ROFName, (String)list1.get(j1));
                        System.out.println(delMap.toString());
                        long l = reconIntf.createDeleteReconciliationEvent(sObjectName, delMap);
                        System.out.println("delete recon key--- " + l);
              catch (Exception exception)
                   exception.printStackTrace();
         public void readFile(){
              String s = "readFile()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              File = getFile();
              BufferedReader reader = new BufferedReader(new FileReader(new
                        File(File)));
              String line = "";
              int k = attrMap.size();
              String value[] = new String[k];
              String Header[]= new String[k];
              if (delimeter.equalsIgnoreCase("|"))
                   delimeter = "\\" + delimeter;
                   line = reader.readLine();
                   Header = line.split(delimeter);
                   while((line = reader.readLine()) != null)
                        value = line.split(delimeter);
                        k = value.length;
                        for (int i = 0;i<k;i++){
                             finalMap.put(attrMap.get(Header), value[i]);
                        System.out.println(finalMap.toString());
                        System.out.println("Start Ignoring Event");
                        if (!(reconIntf.ignoreEvent(sObjectName, finalMap)))
                             System.out.println("Not Ignored");
                        long l1 = reconIntf.createReconciliationEvent(sObjectName, finalMap, true);
                        System.out.println("Recon Key--" + l1);
                        else
                             System.out.println("ignore event ---" + finalMap.toString());
                        list.add(finalMap.get("User Id"));
                        System.out.println(list.size() + "add--" +finalMap.get("User Id") );
                        finalMap.clear();
              catch (Exception exception)
                   exception.printStackTrace();
         public boolean stop(){
              String s = "stop()";
              //logger.setMethodStartLog(classname, s);
              //logger.info(classname, s, "Stopping Reconciliation........");
              isReconStopped = true;
              //logger.setMethodFinishLog(classname, s);
              return true;
         FileFilter fileFilter = new FileFilter()
         public boolean accept(File file)
         String sFilePath = file.getName();
         if( sFilePath.startsWith(FileName) )
         return true;
         else
         return false;
         public String getFile() throws FileNotFoundException, Exception{
              String s = "getFile()";
              //logger.setMethodStartLog(classname, s);
              String s1;
              File dir =     new File(FileDirectory);
              File[] files = dir.listFiles(fileFilter);
              if (files.length ==0)
                   throw new FileNotFoundException();
              if (files.length>1)
                   throw new Exception("Multiple Matches found for this file name");
              s1 = files[0].toString();
              //logger.setMethodFinishLog(classname, s);
              return s1;
         public HashMap readLookup(String s1){
              String s = "readLookup()";
              //logger.setMethodStartLog(classname, s);
              HashMap map = new HashMap();
              try {
              tcResultSet tc1=     lookupIntf.getLookupValues(s1);
              int i = tc1.getRowCount();
              for (int j = 0;j<i;j++){
                   tc1.goToRow(j);
                   map.put(tc1.getStringValue("Lookup Definition.Lookup Code Information.Code Key"), tc1.getStringValue("Lookup Definition.Lookup Code Information.Decode"));
              catch (tcAPIException tcapiexception){
                   tcapiexception.printStackTrace();
                   //logger.error(classname, s, tcapiexception.toString());
                   //logger.setStackTrace(tcapiexception, classname, s, tcapiexception.getMessage());
              catch (Exception excep){
                   excep.printStackTrace();
                   //logger.error(classname, s, excep.toString());
                   //logger.setStackTrace(excep, classname, s, excep.getMessage());
              return map;

  • Error while running scheduled task

    Im getting this error when I am running a scheduled task for adding all users to a group if they are managers:
    Error while running task: Thor.API.Exceptions.tcAPIException: [EJB:010160]Security Violation: User: '<anonymous>' has insufficient permission to access EJB: type=<ejb>, application=Xellerate, module=xlDataObjectBeans.jar, ejb=tcGroupOperations, method=addMemberUser, methodInterface=Remote, signature={long,long}.
    any idea?

    no luck.
    im getting following errors:
    updatamanagergroup.java:3: package Thor.API.Operations does not exist
    import Thor.API.Operations.*;
    ^
    updatamanagergroup.java:4: package Thor.API does not exist
    import Thor.API.tcResultSet;
    ^
    updatamanagergroup.java:5: package Thor.API does not exist
    import Thor.API.tcUtilityFactory;
    ^
    updatamanagergroup.java:6: package com.thortech.xl.crypto does not exist
    import com.thortech.xl.crypto.tcCryptoUtil;
    ^
    updatamanagergroup.java:7: package com.thortech.xl.scheduler.tasks does not exist
    import com.thortech.xl.scheduler.tasks.SchedulerBaseTask;
    ^
    updatamanagergroup.java:8: package com.thortech.xl.util.config does not exist
    import com.thortech.xl.util.config.ConfigurationClient;
    ^
    updatamanagergroup.java:13: cannot find symbol
    symbol: class SchedulerBaseTask
    public class updatamanagergroup extends SchedulerBaseTask
    ^
    and so on....
    23 errors
    Edited by: user11136275 on Dec 24, 2009 12:22 AM

  • Run several tasks at the same time

    Hi,
    I have a NI-SCXI-1600 USB DAQ with SCXI 1520 strain analog input (40 channels)
    I have to run one task with 5 channels right now.Later I have to run another task with another 5 channels while keeping the previous 5 channels going. Is it possible? 
    Thanks.

    Hello Jiqiu,
    Please respond back in this duplicate thread if you have further questions.
    Gerardo O.
    RF Systems Engineering
    National Instruments

  • Scheduled Tasks - System Idle Timer

    I recently upgraded to Windows 8.1. Unfortunately, my NIC prevents the system from automatically entering Hibernate (if I disable/unplug it the system sleeps properly). To work around this, I thought I would use a Scheduled Task to run shutdown /h after
    x minutes of inactivity (probably an hour).
    I set my task's trigger to be an hourly check indefinitely.
    I set the action to be shutdown /h
    I set the conditions to be:
    Start the task only if the computer is idle for: 1 hour (checked)
    Wait for idle for: Do not wait
    The problem I have found is that the task runs if the computer has been idle for only four minutes as per the Task Idle Conditions states (http://msdn.microsoft.com/en-us/library/windows/desktop/aa383561%28v=vs.85%29.aspx). In my mind I should leave the
    computer alone, the hour ticks over and the task is initiated. It should then check to see how long the system has been idle for:
    >= 1 hour? Run the task
    < 1 hour? Do nothing until the next hour
    What seems to be happening is it is checking for an idle state and running the task, even if the computer has only been idle for the minimum four minutes.
    Has anyone else found this issue? Are there any ideas on how I can fix this? My next idea is to write a batch file to sleep for an hour and then hibernate and to have the task cancel the batch process when the system is no longer idle. Seems like it could
    work.
    Thanks in advance.

    Hi vdboots. The question is regarding Task Scheduling and the idle timer, not the issues my system has with hibernating automatically.
    To answer your query, yes I have disabled all devices from waking the computer. The Microsoft drivers for my NIC for some reason keeps the machine awake. I installed the manufacturer's Windows 7 drivers (of course they didn't release any Windows 8 ones...)
    and the machine would sometimes enter hibernation, but mostly would just stay on. The only way I could get the computer to automatically hibernate was to disable the NIC altogether, but that is hardly a solution.
    As I said, this question is about why Windows doesn't seem to be waiting for 1 hour idle time before initiating the task. The action of the task is fairly irrelevant, in fact for my testing I just launch cmd and run time /t.

  • Creating a scheduled task to sync phone's using PC...

    I have two NOKIA (bluetooth) Phones and want to create a scheduled task to synchronise their agenda to outlook without user involvment. Using PCSync2 and some batch file I can get the synchronisation to work.
    One problem however remains. When both telephones are connected then a "phone selection" window appears. You have to manually choose which telephone to use. This makes the scheduled (automatic) task to wait for user involvment.
    I have two questions:
    1
    are there any commandline parameters or registry settings to make clear which telephone to use during the next sync, and the selection window not to appear?
    2
    Are there any commandline parameters or registry settings to have PC Suite think that just one telephone is present (that the  second one is temporary inactive or switched off). Then again the selection window would not appear.

    Here is a functioning task It can be easily edited in PowerShell or in notepad to alter the timing
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.1" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
    <RegistrationInfo>
    <Author>W8TEST\user01</Author>
    </RegistrationInfo>
    <Triggers>
    <CalendarTrigger>
    <StartBoundary>2014-06-04T21:31:32.0459499</StartBoundary>
    <Enabled>true</Enabled>
    <ScheduleByMonth>
    <DaysOfMonth>
    <Day>1</Day>
    <Day>12</Day>
    <Day>24</Day>
    </DaysOfMonth>
    <Months>
    <January />
    <February />
    <March />
    <April />
    <May />
    <June />
    <July />
    <August /
    <September />
    <October />
    <November />
    <December />
    </Months>
    </ScheduleByMonth>
    </CalendarTrigger>
    </Triggers>
    <Principals>
    <Principal id="Author">
    <RunLevel>LeastPrivilege</RunLevel>
    <UserId>W8TEST\jvierra</UserId>
    <LogonType>InteractiveToken</LogonType>
    </Principal>
    </Principals>
    <Settings>
    <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
    <StopIfGoingOnBatteries>true</StopIfGoingOnBatteries>
    <IdleSettings>
    <StopOnIdleEnd>true</StopOnIdleEnd>
    <RestartOnIdle>false</RestartOnIdle>
    </IdleSettings>
    <Enabled>true</Enabled>
    <Hidden>false</Hidden>
    <RunOnlyIfIdle>false</RunOnlyIfIdle>
    <WakeToRun>false</WakeToRun>
    <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
    <Priority>7</Priority>
    </Settings>
    <Actions Context="Author">
    <Exec>
    <Command>notepad.exe</Command>
    <Arguments>test.txt</Arguments>
    <WorkingDirectory>c:\temp</WorkingDirectory>
    </Exec>
    </Actions>
    </Task>
    I have edited and reloaded the XML many, many times.  It works very nicely.
    ¯\_(ツ)_/¯

  • Window Defender scheduled task failed

    The Windows Defender scheduled task is terminated each time and the error code is Ox41306. Anyone know what needs to be done to resolve issue.

    Hi,
    0x00041306
    The last run of the task was terminated by the user.
    Did you create the task schedulder via GUI or you create and run the scheduler via some script? Please make sure that you have right permission to run the task or script. chekc the security option, check the user acocunt to run the task.
    Or check this option, under "power" tab, task might be terminated when power environment has changed
    Yolanda Zhu
    TechNet Community Support

  • Scheduled Tasks - Administrator Best Practices

    Hi all,
    I've gotten assistance this week with a couple scripts and scheduling them as tasks. I actually have well over a dozen running on our Exchange server using a special user with a complex password. This user is not used for logging into any machine, but it
    is a member of 'Administrators' group and can be used for tasks requiring elevated privileges.
    What I am interested in learning is what the best practice is for running scheduled tasks. We have several, such as querying AD for members of select OUs or users who meet certain criteria. We also have automated emails regarding certain mailbox metrics,
    etc. You get the idea.
    Despite the complex credentials, this account is still discoverable and could be used in nefarious ways. Is it possible be running tasks on Server 2008 R2 (2012 possibly) without administrator credentials? Are there certain restrictions for the tasks (like
    is a scheduled reboot allowed by a standard account, but not querying Active Directory?).
    I also have noticed a checkbox with 'Run with  highest privileges' and do not fully understand what this means.
    When I try to run the task as a regular user (no remote permissions) and it says 'Logon failure: the user has not been granted the requested logon type as this computer.'
    In short, can I safely remove our special user account from 'Administrators' and place into regular users without breaking all of our tasks?

    Hi KSI-IT,
    Firstly, based on my research, if you want to run the task scheduler with a user account, the user account must have the corresponding permission, in other words, you can also manually run the script with the user account.
    1.  For the error you posted 'Logon failure: the user has not been granted the requested logon type as this computer', please make sure the task account has "logon as a batch job" privilege.
    To add the privilege of the account, please go to
    [Local Security policy\Local Policies\User Rights Assignment]
    -Log on as a batch job.
    Add the domain\username account and any others you may need and retry.
    2.  For the setting 'Run with  highest privileges', this means that it runs with the highest privileges available to that user. This is different from the context menu's 'Run As Admin'.
    It generates the highest privilege token for the specific user, however, it cannot run as a different user, for a standard user with no elevated permissions, 'Run with highest privileges' does not do anything.
    Reference from:
    What
    effect does "run with highest priviledges" in task scheduler have on powershell scripts?
    I hope this helps.

  • [Forum FAQ] Fixing scheduled task Next Run Time displaying as expired time plus days to delete

    Symptom:
    We used Task Scheduler to create a scheduled task. For example, we configured a daily task, starting from 3 AM 9/3/2014, recurring the task every 1 day, and set the expiration time as 3 AM 9/3/2015 (See Figure 1). Under
    Settings tab, we checked If the task is not scheduled to run again, delete if after:
    option, and set the value as 30 days (See Figure 2).
    However, in the Task Scheduler Library snap-in, we saw that the Next Run Time of the task is 3AM 10/3/2015, which equals expiration date plus days to delete (See Figure 3), but the right value should be 3 AM 9/2/2014 because the task has never been run.
    Figure 1
    Figure 2
    Figure 3
    Cause:
    This is a Task Scheduler interface displaying issue. Although the next run time that is displayed in the Task Schedule is incorrect, the trigger will be fired correctly.
    Solution:
    We can install the hotfix in the following KB article to fix the displaying issue, though the symptom in the article is different.
    An incorrect value for Next Run Time is displayed when you specify multiple triggers to schedule a task in Windows Vista, Windows 7, Windows Server 2008 or Windows Server 2008 R2
    http://support.microsoft.com/kb/2495489
    After installing the hotfix, we need to restart computers to make it take effect.
    In this example, after installing the hotfix and restarting the computer, we see that the next run time of the task is displayed correctly in Task Scheduler (Figure 4).
    Figure 4

    I am not running out of space, but I do have the same problem.  Every so often TM does a backup which is about 60 GB bigger than expected.   The  extra is always a new backup of /System /Applications /usr etc. - that is the 'system files'.
    The key thing is, as you have noticed:
    Examining the content of the latest backup, the one that did not fail, shows that some system directories, /Applications, /usr, and /bin are missing
    As a consequence the next backup is, in my case, 60 GB bigger because it includes all the system files.
    It is as if 'systemFilesExcluded' was turned on for the previous backup (the one that 'did not fail').  But I have looked in the .exclusions.plist for this backup and it is exactly the same as for other backups and does include:
            <key>systemFilesExcluded</key>
            <false/>
    It seems that TM is treating this as if <true/>.
    Like you, I have done a disk verify and it finds no errors.
    I think this must be a bug.  I have had this on four occassions since upgrading to Mountain Lion.  And it is doing a large one right now - I have caught it in the act!

  • Windows Server Backup scheduled task run successfully but backup do not start (not running) on Windows Server 2012

    Hi,
    A backup job has been setup on Windows Server 2012 (Platform: Win32NT; ServicePack: ; Version: 6.2.9200.0; VersionString : Microsoft Windows NT 6.2.9200.0) via Windows Backup Software UI (Local Backup 1.0).
    It is appearing as a scheduled task "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup" belonging to user 'nt authority\system' in task scheduler.
    The problem is that the Backup job never start despite the scheduled task running and completing successfully (when run automatically or manually)!
    Would you be able to explain why and assist in resolving that issue?
    Here is what we know:
    When the backup is run manually via the Windows Backup Software UI, it works fine.
    When the backup is run via command line (as set in schedule task) in a cmd command prompt (as local/domain 'administrator' or as 'nt authority\system' which is possible by running command prompt via 'PsExec.exe -i -s cmd'), something like "%windir%\System32\wbadmin.exe
    start backup -templateId:{f11eb3aa-74e7-4ff4-a57b-d8d567ee3f77} -quiet", it works fine.
    If you manually run the preset scheduled task while logged in as administrator, the task run and complete successfully but the backup job does not start.
    Idem if you schedule task is run automatically at scheduled time.
    The schedule task run and complete successfully but the backup job does not start.
    It is confirmed by running the following in a command prompt as 'nt authority\system':
    schtasks /run /tn "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup"
    SUCCESS: Attempted to run the scheduled task "\Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup".
    Despite success result, the Backup job does not start running...
    No errors or warning appears anywhere in Event Logs (Microsoft > Windows > Backup or Task Scheduler) nor in the scheduled task History tab. The schedule task complete successfully but no Backup job is run...
    If scheduled task automatically set by Windows Backup software is duplicated (copied) and set manually it runs fine as 'administrator' and as 'nt authority\system' (subject that 'nt authority\system' is added to the 'Backup Operators' AD group).
    Here is an export of the current pre-set schedule task, is there any settings that need to be changed to make it works?
    <?xml version="1.0" encoding="UTF-16"?>
    <Task version="1.4" xmlns="http://schemas.microsoft.com/windows/2004/02/mit/task">
      <RegistrationInfo>
        <Author>MYDOMAIN\SERVER1</Author>
        <SecurityDescriptor>D:AR(A;OICI;GA;;;BA)(A;OICI;GR;;;BO)</SecurityDescriptor>
      </RegistrationInfo>
      <Triggers>
        <CalendarTrigger id="Trigger 1">
          <StartBoundary>2014-07-14T21:00:00</StartBoundary>
          <Enabled>true</Enabled>
          <ScheduleByDay>
            <DaysInterval>1</DaysInterval>
          </ScheduleByDay>
        </CalendarTrigger>
      </Triggers>
      <Principals>
        <Principal id="Author">
          <UserId>S-1-5-18</UserId>
          <RunLevel>HighestAvailable</RunLevel>
        </Principal>
      </Principals>
      <Settings>
        <MultipleInstancesPolicy>Parallel</MultipleInstancesPolicy>
        <DisallowStartIfOnBatteries>true</DisallowStartIfOnBatteries>
        <StopIfGoingOnBatteries>false</StopIfGoingOnBatteries>
        <AllowHardTerminate>true</AllowHardTerminate>
        <StartWhenAvailable>true</StartWhenAvailable>
        <RunOnlyIfNetworkAvailable>false</RunOnlyIfNetworkAvailable>
        <IdleSettings>
          <StopOnIdleEnd>false</StopOnIdleEnd>
          <RestartOnIdle>false</RestartOnIdle>
        </IdleSettings>
        <AllowStartOnDemand>true</AllowStartOnDemand>
        <Enabled>true</Enabled>
        <Hidden>false</Hidden>
        <RunOnlyIfIdle>false</RunOnlyIfIdle>
        <DisallowStartOnRemoteAppSession>false</DisallowStartOnRemoteAppSession>
        <UseUnifiedSchedulingEngine>false</UseUnifiedSchedulingEngine>
        <WakeToRun>false</WakeToRun>
        <ExecutionTimeLimit>P3D</ExecutionTimeLimit>
        <Priority>7</Priority>
      </Settings>
      <Actions Context="Author">
        <Exec>
          <Command>%windir%\System32\wbadmin.exe</Command>
          <Arguments>start backup -templateId:{f11eb3aa-74e7-4ff4-a57b-d8d567ee3f77} -quiet</Arguments>
        </Exec>
      </Actions>
    </Task>
    Thank you in advance for your feedback.

    Once again, the issue is not to run the backup manually from the command line but to have it run via the scheduled task setup by the Windows Backup software.
    By default, the schedule task is to be run as NT Authority\System, and when run under this account, the backup does not start (even though account is member of Backup Operators) and job can manually be run via elevated command prompt. This is not a normal
    behavior and constitute a major bug in Windows Server 2012.
    From my understanding the NT Authority\System account is a built-in account from Windows that should by default be part of the Administrators group (built-in) even though it does not explicitly appears like it in AD by default.
    This account shall have by default Administrators rights and Backup Operators rights (via the Administrators group) without being explicitly added to those groups (http://msdn.microsoft.com/en-gb/library/windows/desktop/ms684190%28v=vs.85%29.aspx). By design
    it is supposed to be the most powerful account which has unrestricted access to all local system resources. If that is not the case (as it seems) then this would constitute a major bug in Windows Server 2012 edition.
    As said previously and as you confirmed, currently by default NT Authority\System on Windows 2012 server cannot start backup manually via an elevated command prompt unless it is manually added to Backup Operators (or Administrators) group. But wouldn't that
    constitute a bug of Windows Server 2012?
    Our server has not yet been restarted since I added NT Authority\System account to the Administrators group explicitly manually so I cannot yet confirmed it would sort the issue. Indeed it is heavily in use so cannot easily be restarted. Will confirm when
    done.
    We also have an additional problem where after a while of last reboot, part of the Exchange ECP can no longer be properly loaded in the web browser due to compilation error (compilation is done via NT Authority\System account which seems to no longer have
    sufficient right to compile .NET code). What is strange is that it works at first and then stop working at some point... I am hopeful that adding NT Authority\System to the Administrators group would sort this issue as well but once again, that shall not be
    needed!!!
    Could a Windows Server 2012 update introduced some security policy changes or else that prevent NT Authority\System to have full power?

  • How can I setup a scheduled task to run a Powershell Script delivered as a Group Policy Preference

    I have a Powershell script I want to run only once when a user logs onto their system. This script would move all the PST files from the Local drive and the Home drive to a folder location within the users profile. I wanted to run this as a Windows 7 Scheduled Task using Group Policy Preferences. How can I get this to happen short of a logon script? I have updated all the machines to WMF 4.0 so could I use a Scheduled Job instead? I wanted to run the script as the logon user but elevated.#Start Outlook and Disconnect attached PST files.
    $Outlook = New-Object -ComObject Outlook.Application
    $namespace = $outlook.getnamespace("MAPI")
    $folder = $namespace.GetDefaultFolder("olFolderInbox")
    $explorer = $folder.GetExplorer()
    $explorer.Display()
    $myArray= @()
    $outlook.Session.Stores | where{ ($_.FilePath -like'*.PST') } | foreach{[array]$myArray+= $_.FilePath}
    for
    ($x=0;$x-le$myArray.length-1;$x++)
    $PSTPath= $myArray[$x]
    $PST= $namespace.Stores | ?{$_.FilePath -like$PSTPath}
    $PSTRoot= $PST.GetRootFolder() #Get Root Folder name of PST
    $PSTFolder= $Namespace.Folders.Item($PSTRoot.Name) #Bind to PST for disconnection
    $Namespace.GetType().InvokeMember('RemoveStore',[System.Reflection.BindingFlags]::InvokeMethod,$null,$Namespace,($PSTFolder)) #Disconnect .PST
    #Move All PST files to the default location while deleting the PST files from their original location.
    $SourceList = ("$env:SystemDrive", "$env:HOMEDRIVE")
    $Destination = ("$env:USERPROFILE\MyOutlookFiles")
    (Get-ChildItem -Path $SourceList -Recurse -Filter *.PST) | Move-Item -Destination $Destination
    #Attach all PST files from the default location.
    Add-type -assembly "Microsoft.Office.Interop.Outlook" | out-null
    $outlook = new-object -comobject outlook.application
    $namespace = $outlook.GetNameSpace("MAPI")
    dir “$env:USERPROFILE\MyOutlookFiles\*.pst” | % { $namespace.AddStore($_.FullName) }

    Mike,
    I do not understand what appears to be a regular expression above. I did add the PowerShell script to the HKCU RunOnce Key as suggested.
    Windows Registry Editor Version 5.00
    C:\WINDOWS\system32\WindowsPowerShell\v1.0\powershell.exe -noprofile -sta -WindowStyle Hidden -ExecutionPolicy RemoteSigned -File "C:\scripts\Windows PowerShell\Move-PST.ps1"
     I'm delivering this using Group Policy Preferences. It seems to fail or time out when run because the behavior is different if I run the script from within the PowerShell IDE. I added the parameters to the script and will try it again in the morning.

  • [Forum FAQ] Group Policy Preferences Scheduled Tasks Item not working when the option Run whether user is logged on or not is selected

    Scenario:
    We use one of the following Group Policy Preferences Scheduled Tasks item to deploy a task to clients:
    Computer Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7)
    Computer Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Immediate Task (At least Windows 7)
    User Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Scheduled Task (At least Windows 7)
    User Configuration -> Control Panel Settings -> Scheduled Tasks -> New -> Immediate Task (At least Windows 7)
    (Note that on some platforms, "At least Windows 7" is replaced with "Windows Vista and later.")
    After designating a user account to run the task, we select “Run whether user is logged on or not” option, and “The Do not store password…”
    check box is automatically grayed out (See Figure 1).
    Figure 1
    After finishing configuring the task item, on a client, we run command
    gpupdate/force to forcefully update group policy. However, on the client, when we check if the task is listed in Task Scheduler snap-in, the task is not displayed, and when we run
    gpresult/h report.html to collect group policy result for troubleshooting, we see an error as similar as shown in the following figure (Figure 2).
    Figure 2
    Cause:
    To make the scheduled task run whether the user is logged on or not, we need to store the password of the designated user account. However, for the content of the scheduled
    task item is stored in Sysvol where it’s not safe to store passwords, this function has been deprecated.
    Workaround:
    We can run the task with system account
    NT Authority\System, or we can use specific user accounts to run the task when the given user is logged on. (See Figure 3)
    Figure 3
    Reference:
    MS14-025: Vulnerability in Group Policy Preferences could allow elevation of privilege: May 13, 2014
    http://support.microsoft.com/kb/2962486
    Please click to vote if the post helps you. This can be beneficial to other community members reading the thread.

    Hello Everyone,
    Succeeded !!!!!!!
    Even i was struggling with this same Problem to execute a batch via Window scheduler and set the setting to "Run whether the user is logged in or not".
    I tried many time but the batch runs with " Run
    whether user is logged on" and not with "Run
    whether user is logged on or not".
    what i discovered is that there was one mapped drive
    path in my batch file which was not the complete path like y:/AR.qvw actually what i did i changed that map path to the complete path like \\servnamename\d$\AR.qvw and the batch executed successfully with the setting "Run
    whether user is logged on or not"
    The
    conclusion is that check the dependency of the script on external resources because when you check this option "Run
    whether user is logged on or not" It actually conflicts. This my discovery.
    If
    you have any question write me on [email protected]
    Thanks
    & Regards,
    Arun

  • Batch/Powershell file wont run via Task Scheduler

    Hello,
    I'm having trouble getting my Powershell file to run from Task Schedule during logoff. In short, I'm trying to upload my NTUSER.DAT (roaming profile) to my profiles folder on the file server. Dynamic VLAN switching does not support roaming profiles thus
    I have to use a script to solve this issue.
    My powershell script is as follows:
    start-sleep -s 15
    Set-Content -Path "C:\Temp\log.txt" -Value "Hello World"
    $FileServer = 10.10.5.5
    $FQDN = "$Env:UserDomain"
    $User = Get-WmiObject -Class Win32_NetworkLoginProfile | Sort-Object -Property LastLogon -Descending | Select-Object -Property * -First 1 | Where-Object {$_.LastLogon -match "(\d{14})"} | Foreach-Object { New-Object PSObject -Property @{ Name=$_.Name.TrimStart("$FQDN\") }} | Select -ExpandProperty Name
    copy-item -path C:\Users\$User\NTUSER.DAT -destination \\$FileServer\Profiles$\$user.V2\ -force
    copy-item -path C:\Users\$User\NTUSER.DAT -destination \\$FileServer\Profiles$\$user.V3\ -force
    I have a task schedule to run as Domain Admin when event ID 4647 occurs (logoff). It is set to run with the Highest Privileges checked, also I have enabled to run weather the user is logged in or no. The Domain Admin account also has access to ever file,
    both at source and destination. Set-ExecutionPolicy is set to unrestricted. The way I call the powershell script in Task Scheduler is:
    Action: Start a program
    Program/Script: C:\temp\launch.bat
    The launch.bat contains the following:
    Powershell.exe -executionpolicy unrestricted -File "CALL C:\temp\powershell.ps1"
    The task is triggered each time when the user logs off, I have confirmed this in the logs. But the NTUSER.DAT file fails to copy over to the network, in fact the log.txt file isn't even generated. I have confirmed my code to work, it's just the task scheduler
    part calling the code where I think it fails.
    Can you guys point me in the right direction here? I know I'm close, but not sure what I'm missing. 

    Jrv,
    Yes in my testing the task schedule is unreliable, I don't have any info on how long the profile is locked, thus I can't copy the profile to the server when the OS still has it locked.
    What do you propose I change my vlan configuration to?
    Thanks.
    What you are trying to do cannot be done.  That is why it is not being done.  If you set up roaming profiles and redirected folders this would happen automatically.  It would also happen very quickly.  THat is because Windows posts cahnges
    to teh roamed image as they happen.  Only changes are copied. Items in teh registry which are only valid during logon (Dynamic Entries) are nver copied so updates that are not needed are not posted.  It is these updates thaat can keep the registry
    locked for a very long time.
    If you scan your network you will likely find hives thaat are loaded with no one logged in.  WIndows 7 and later have a utility that forces and unload after a few minutes.  It posts the reson for the forced unload to the event log.
    As for the VLAN it is likely not configured correctly.  THe profile must be on a server that is available on the same net ID as the PC.  YOu may also have to allow the switch to suspend if you are using per-user conenctions.  Contact the VLAN
    vendor and tell them about issues with Roamed profiles.  THey will walk you through the setup.  THe most common issue is thaat the switch specifies 1Gb and the server is set to 100Mb and the switch is not set to match the speed.  THisis a simplpe
    configuration error done by a tech who does not have much experience with VLANs.  THey tend to think that setting everything to 1Gb or some other maximum will work but it won't.  It can also be caused by a files server with a 1Gb card that is a pront
    spooler spooling to a 100 or 10Mb older printer. This disrupts the card and the VLAN cannot attach to it until the spooler is dona nd the card can switch.  It can also be caused by a bad card or a bad switch.
    Then VLAN vendors techs are usually very good at troubleshooting this kind of issue.  Remote VLAN logging and diagnostics can also pick out the issue.
    ¯\_(ツ)_/¯

Maybe you are looking for

  • How do I save pictures from iPhoto iPad app in full resolution?

    When I import a large 6-9MB picture into the iPhoto app on iPad for editing, and then save it to my camera roll, the resulting picture is 150-200KB. How can I save it in full resolution after it's been edited?

  • Creating WS from a pl/sql package (return ref_cursor) on a 9i database

    Howdy, I can create and deploy a ws built from pl/sql package on a 9i database that returns a ref_cursor. When I test it via my app server it throws the following: ERROR>oracle.xml.sql.OracleXMLSQLException: Character '#' is not allowed in an XML tag

  • Accrual plans validation

    Hi, We have absences and accrual plan set up to validate the entitlements. we have addded the validation in the user hook to raise an error if p_exceeds_pto_entit_warning. but if the absence scheme is not attached to the employee i.e. the element is

  • Unable to Connect to Database from Forms/Reports 6i

    I can't find anything wrong with my TNSNAMES.ORA file, yet I can't connect to my database through forms or reports. The errors I keep getting is TNS-12154 and TNS-12203. Please advise. Thanks in advance. E

  • SmartView Automation in 11.1.2

    Hi I was using smart view with 9.3 in Excel and automate my smart view refresh using Smart View APIs & VBA code In 9.3, we need to create a connection in connection manager and re-use that connection in VBA code. The smart view login prompt only came