Task Scheduler doesn't work

Slightly leading title. It does work when you set the tasks up and works fine for a while. Then all the tasks begin failing at some random point.
I have several small EXEs and a piece of kit called SyncBackup in the server. These are the tasks to be executed.
Sticking with the EXEs I built myself which are .NET apps, these are lightweight apps which connect to a database and write to a log file.
RDP in as Administrator and double-click the EXE - runs fine.
Set up a Scheduled Task to run it every 5 minutes - fine. Right click, run task - executes perfectly. Job complete, last run status fine.
Go away and leave the server for a few days - runs fine.
Then it just stops working with code 0xC0000142. For every single Scheduled Task. Except one which I think returns 0xC01.
Task History shows "Action completed" and "Task Completed" as if it's all working perfectly. But it isn't. No errors logged or evident there.
I have these all set up to run as the Administrator for testing purposes.
Why do these tasks run fine when set up and break "behind your back" at some later stage? What does this error code mean? How do I get these working and importantly, *stay working*?
I've seen stacks of threads like this with no resolution. A common issue appears to be the Start In directory specification.
It doesn't make any difference whether you specify the Start in directory or not. There are no spaces in the file names or paths anyway so quote marks irrelevant.
And, these tasks do work initially - they just break later on.
I've come across a piece of third party kit which emulates what the Windows Task Scheduler does and am tempted to install and use that instead.
But the Windows Task Scheduler always used to work... ;)

I was waiting until this evening to see if restarting the server would fix this.
And it has.
All the tasks work perfectly - those failing with both the error codes, so that's my own apps and also the SyncBackup tasks.
For now...
Digging around some more, I'm led to believe this might have something to do with "Desktop Heap" size.
http://blogs.msdn.com/b/ntdebugging/archive/2007/01/04/desktop-heap-overview.aspx
Thing is, this never used to happen up until very recently on one of my servers, I migrated to a new one (not because of this) mystified by the problem and hoping the problem would vanish. And it did, at first.
One other server I have which runs SyncBackup tasks doesn't have this issue.
All Windows Server 2008 R2 and all up to date with hotfixes.
I'm reluctant to modify the Desktop Heap size without a more detailed understanding and still mystified as to why this all worked perfectly until about three weeks ago.

Similar Messages

  • Task Scheduler doesn't work for restarting the server but event log says successful.

    Hi All,
         I have created a scheduler task to run every weekend to restart the Windows Server 2008 R2 Standard(64 Bit OS). The task everything has been successfully created. I check manually if it actually restarts but it doesn't but on the event
    logs of the Task Scheduler it says restarted successfully and returns status code 0. But it doesn't seem to work.
    Thanks in advance.

    Hi Prasad Venkatesan,
    Can you tell more detailed information about how do you set this scheduled task?
    To create a scheduler of restarting at specific time, please also try these steps:
    Press WinKey+R > type taskschd.msc and press Enter (it will launch Task Scheduler)
    Left click from the right pane on the Task Scheduler Library > open Action from the top menu > New Folder... > name it MyTasks
    > click OK
    Left click on the MyTasks > choose Action from menu > Create Basic Task... (it will open task wizard)
    You can enter the Name , for example "Restart", and press Next
    In Trigger section you can specify when you want to run your task, for example:
    Select Daily , and press Next
    Now you can specify the day, the hour and set to recur every day, after that press Next
    In Action section you can choose what you want to run, for example restart your system, to do this:
    choose Start a program , and press Next
    in the Program/script field type shutdown /r , and press Next
    please press Finish
    Then check if it can work.
    Best Regards,
    Anna

  • Exchange 2010 task scheduled scripts not working if not logged on

    Hi All,
    I have done a script for Exchange 2010 and I would like to create a scheduled task for it.
    I have followed the guidance of Mike Pfeiffer's blog.
    http://www.mikepfeiffer.net/2010/02/creating-scheduled-tasks-for-exchange-2010-powershell-scripts/
    However when I set the task as  “Run whether user is logged on or not”, it only works if the user running the task is the administrator. The task is run with high privileges.
    If I do it with a service account (local admin, exchange org admin) it works only when:
    -You run the script for an interactive session of the user or a runas cmd
    -You set the Task as “Run only when the user is logged on” (and the user is logged on)
    If I run the Task as “Run whether user is logged on or not” and the user is not logged on, I get an error on the connection command "Connect-ExchangeServer -auto" (and the task hangs waiting for an answer). The transcript is as follows:
    Transcript started, output file is C:\scripts\informes\pruebasconexion.Log.txt
             Welcome to the Exchange Management Shell!
    Full list of cmdlets: Get-Command
    Only Exchange cmdlets: Get-ExCommand
    Cmdlets that match a specific string: Help *<string>*
    Get general help: Help
    Get help for a cmdlet: Help <cmdlet name> or <cmdlet name> -?
    Show quick reference guide: QuickRef
    Exchange team blog: Get-ExBlog
    Show full output for a command: <command> | Format-List
    Tip of the day #31:
    Tab completion reduces the number of keystrokes required to complete a cmdlet. Just press the TAB key to complete the cmdlet you are typing. Tab completion kicks in whenever there is a hyphen (-) in the input. For example:
     Get-Send<tab>
    should complete to Get-SendConnector. You can even use wildcards, such as:
     Get-U*P*<tab>
    Pressing the TAB key when you enter this command cycles through all cmdlets that match the expression, such as the Unified Messaging Mailbox policy cmdlets.
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to CAS01.XXX.es
     An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas01.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas02.XX..Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to MBX02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://mbx02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS01.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas01.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    VERBOSE: Connecting to CAS02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://cas02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    WARNING: The service  () isn't running. Connecting to remote Powershell requires this service to be running.
    VERBOSE: Connecting to MBX02.XXX.es
    An internal error occurred. 
        + CategoryInfo          : InvalidArgument: (http://mbx02.XX...Ver=14.1.218.15:Uri) [], PSInvalidOperationException
        + FullyQualifiedErrorId : CreateRemoteRunspaceFailed
    Failed to connect to an Exchange server in the current site.
    Enter the server FQDN where you want to connect.:
    The error message refers to a unkown "() service", but I have no clue of which service can be needed and it is working only when session is opened.
     The command I run is
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'c:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1';c:\scripts\informes\estado_db_dag.ps1"
    UNICAN-SdeI

    I experienced a similar symptom where the scheduled task was getting stuck in the "Running" state. I searched the web for others who have experienced this issue with scheduled tasks, and what I found is that there could be a few reasons why
    this might happen. 
    I resolved my problem by adding -NonInteractive switch before the -command parameter.
    Hope it helps...
    In my case, -NonInteractive does indeed stop the task from getting stuck in a perpetual Running state (until it times out based on the settings in scheduled task), but I was able to deduce why by using Start-Transcript and Stop-Transcript.
    Basically, the connection to Exchange is failing some reason and it sits at a prompt waiting for you to enter a FQDN for an Exchange server (same problem as the OP).  Adding -NonInteractive to the scheduled task does indeed prevent the task from getting
    stuck waiting for someone to enter a FQDN at a prompt that they cannot interact with, the script still does not execute correctly.  Essentially, adding the "-NonInteractive" switch does not fix the underlying problem of the Exchange connection
    failing.
    As far as I am able to tell, this has something do with a WinRM problem.  I'm having the same problem as the OP and am trying to troubleshoot it.  In my case, deleting the user profile for the service account does not fix the problem.

  • Maintenance windows applies only to task sequences doesn't work

    Problem:
    SCCM 2012 R2 CU4
    Task sequence deployment run outside maintenance windows when the maintenance windows is set to apply only to task sequences.
    When the maintenance windows is set to apply to All deployments, the task sequence deployment run inside maintenance windows as expected.
    The maintenance task defined was as:
    Name: Maintenance Windows of Collection Coll_A
    Time: 10:30am to 06:00am
    Date: 20th March 2015
    Apply this schedule to: Task Sequences
    The task sequence defined was as:
    Deployed to Collection Coll_A
    Time: Run as soon as possible
    The task sequence run at 9:48am on a workstation that is member of Coll_A.
    There aren't other maintenances windows on others collections.
    Below the workstation's serviceWindowsManager.log:
    https://onedrive.live.com/redir?resid=BFBF530F33D996FD!123&authkey=!AI0dFPZ89XCL7xs&ithint=file%2clog

    When was the client added to the collection? Was it able to retrieve those MW policies before it received the TS?
    Torsten Meringer | http://www.mssccmfaq.de
    1_the client was added at the 9:30am.
    2_Yes it is.
    I have done another test and the result is the same:
    _ first setting up the maintenance windows in Coll_A,
    _ then insert the client in Coll_A and force a machine policy evaluation
    _then deploy the task sequence in collection Coll_A

  • Is it a bug - SSIS 2012 ReadOnlyVariables in Script Task doesn't work

    It's very weird when I use the ReadOnlyVariables in SSIS 2012 Script Task, it doesn't work at all!!! And I never notice this change before, but everything in 2008 R2 is fine! Is it a bug in SSIS 2012 ?
    All the variables I set them to "ReadOnlyVariables"
    In scripts - I assigned some values from system variables.
    String PackageName = Dts.Variables["System::PackageName"].Value.ToString();
    DateTime CurrentDate = (DateTime)Dts.Variables["System::StartTime"].Value;
    // User Defined Variables
    Dts.Variables["User::PV_CURRENT_DATE"].Value = CurrentDate;
    Dts.Variables["User::PV_YEAR"].Value = CurrentDate.Year;
    Dts.Variables["User::PV_MONTH"].Value = CurrentDate.Month;
    Dts.Variables["User::PV_DAY"].Value = CurrentDate.Day;
    Dts.Variables["User::PV_PACKAGE_NAME"].Value = PackageName;
    Execute the package, it works !
    The only thing I can make it as SSIS 2008 R2 does is to change the ReadOnly for each variables.
    Then you will get the error.
    Why do we need this feature here but not to use the ReadOnlyVariables in script task ?
    Please vote if it's helpful and mark it as an answer!

    I can reproduce it as well. Feels like a bug...
    Locking the variable for read in code has the same effect:
    public void Main()
    // Lock variable for read
    Dts.VariableDispenser.LockForRead("User::myStringVariable");
    // Create a variables 'container' to store variables
    Variables vars = null;
    // Add variable from the VariableDispenser to the variables 'container'
    Dts.VariableDispenser.GetVariables(ref vars);
    // Now try giving it a new name
    vars["User::myStringVariable"].Value = "new value";
    // Release the locks
    vars.Unlock();
    Dts.TaskResult = (int)ScriptResults.Success;
    For reference:
    https://connect.microsoft.com/SQLServer/Feedback/Details/991697
    Please mark the post as answered if it answers your question | My SSIS Blog:
    http://microsoft-ssis.blogspot.com |
    Twitter

  • EP6.0 SPS16, scheduler doesn't start

    Hi.
    we have some troubles with portal scheduler on the EP 6.0 SPS16, PATCH2 CM&Coll SPS16 (non-cluster environment).
    Because of some reasons the portal sheduler doesn't work.
    In Monitoring->Knowledge Management->Component Monitor is just the error message
    -Scheduler
    Startup Error:  scheduler: runtime exception during    
    start up: null
    -Ice
    Configuration Error:  com.sapportals.wcm.WcmException: 
    Scheduler service not available
    Trace log:
    startup failed : class=com.sapportals.wcm.service.scheduler.SchedulerService, uri=crt://runtime/services/SchedulerService, exception: com.sapportals.wcm.crt.component.StartupException: scheduler: runtime exception during start up: null
    I have tried to assign the correct CM ID to each scheduler task and many other things but nothing helps.
    The company changed the name of windows domain and also the EP was connected to LDAP. It could be the reasons why the scheduler doesn't work.
    Maybe there is some authentication problem or problem with some portal repository.
    Does anybody have some idea how to solve it?
    Thank you!
    Bye
    Dan
    Whole trace log error:
    #1.5#00142211B4D3004300000316000015BC00041530E182785F#1149199592893#com.sapportals.wcm.crt.CrtThreadSafeComponentHandler#sap.com/irj#com.sapportals.wcm.crt.CrtThreadSafeComponentHandler#Guest#2####87171960f1ba11da888900142211b4d3#SAPEngine_Application_Thread[impl:3]_14##0#0#Error##Plain###startup failed : class=com.sapportals.wcm.service.scheduler.SchedulerService, uri=crt://runtime/services/SchedulerService, exception: com.sapportals.wcm.crt.component.StartupException: scheduler: runtime exception during start up: null
         at com.sapportals.wcm.service.AbstractService.start(AbstractService.java:154)
         at com.sapportals.wcm.crt.CrtThreadSafeComponentHandler.tryToStart(CrtThreadSafeComponentHandler.java:246)
         at com.sapportals.wcm.crt.CrtThreadSafeComponentHandler.handleLookup(CrtThreadSafeComponentHandler.java:108)
         at com.sapportals.wcm.crt.CrtComponentManager.lookup(CrtComponentManager.java:322)
         at com.sapportals.wcm.crt.CrtComponentManager.lookupChildComponent(CrtComponentManager.java:403)
         at com.sapportals.wcm.crt.CrtContainerManager.lookupComponent(CrtContainerManager.java:44)
         at com.sapportals.wcm.crt.CrtSystemImpl.lookupComponentByUri(CrtSystemImpl.java:131)
         at com.sapportals.wcm.crt.CrtComponentManager.startUp(CrtComponentManager.java:278)
         at com.sapportals.wcm.crt.CrtSystemImpl.startUpComponentManager(CrtSystemImpl.java:166)
         at com.sapportals.wcm.repository.runtime.CmSystem.startUp(CmSystem.java:225)
         at com.sapportals.wcm.repository.runtime.CmSystem.getInstance(CmSystem.java:164)
         at com.sapportals.wcm.repository.runtime.CmAdapter.getResourceImpl(CmAdapter.java:974)
         at com.sapportals.wcm.repository.runtime.CmAdapter.getResource(CmAdapter.java:192)
         at com.sapportals.wcm.portal.service.KMServiceImpl.afterInit(KMServiceImpl.java:215)
         at com.sapportals.portal.prt.core.broker.PortalServiceItem.__initServiceInstanceStep2(PortalServiceItem.java:867)
         at com.sapportals.portal.prt.core.broker.PortalServiceItem.startServices(PortalServiceItem.java:1081)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.startLoadOnStartupServices(PortalAppBroker.java:1563)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.start(PortalAppBroker.java:1518)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.startNonCoreApplications(PortalAppBroker.java:1469)
         at com.sapportals.portal.prt.runtime.Portal.init(Portal.java:406)
         at com.sapportals.portal.prt.core.PortalCoreInitializer.coreInit(PortalCoreInitializer.java:54)
         at com.sapportals.portal.prt.dispatcher.PortalInitializer.<init>(PortalInitializer.java:129)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doSetupPortalInitializer.run(Dispatcher.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.initDispatcher(Dispatcher.java:359)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.access$000(Dispatcher.java:42)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$InitRunner.run(Dispatcher.java:114)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.init(Dispatcher.java:392)
         at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.addServlet(WebComponents.java:138)
         at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.loadServlets(ApplicationThreadInitializer.java:376)
         at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:110)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)
    java.lang.ClassCastException
         at com.sapportals.wcm.service.scheduler.SchedulerService.createTask(SchedulerService.java:1166)
         at com.sapportals.wcm.service.scheduler.SchedulerService.createEntry(SchedulerService.java:728)
         at com.sapportals.wcm.service.scheduler.SchedulerService.startUpImpl(SchedulerService.java:574)
         at com.sapportals.wcm.service.AbstractService.start(AbstractService.java:141)
         at com.sapportals.wcm.crt.CrtThreadSafeComponentHandler.tryToStart(CrtThreadSafeComponentHandler.java:246)
         at com.sapportals.wcm.crt.CrtThreadSafeComponentHandler.handleLookup(CrtThreadSafeComponentHandler.java:108)
         at com.sapportals.wcm.crt.CrtComponentManager.lookup(CrtComponentManager.java:322)
         at com.sapportals.wcm.crt.CrtComponentManager.lookupChildComponent(CrtComponentManager.java:403)
         at com.sapportals.wcm.crt.CrtContainerManager.lookupComponent(CrtContainerManager.java:44)
         at com.sapportals.wcm.crt.CrtSystemImpl.lookupComponentByUri(CrtSystemImpl.java:131)
         at com.sapportals.wcm.crt.CrtComponentManager.startUp(CrtComponentManager.java:278)
         at com.sapportals.wcm.crt.CrtSystemImpl.startUpComponentManager(CrtSystemImpl.java:166)
         at com.sapportals.wcm.repository.runtime.CmSystem.startUp(CmSystem.java:225)
         at com.sapportals.wcm.repository.runtime.CmSystem.getInstance(CmSystem.java:164)
         at com.sapportals.wcm.repository.runtime.CmAdapter.getResourceImpl(CmAdapter.java:974)
         at com.sapportals.wcm.repository.runtime.CmAdapter.getResource(CmAdapter.java:192)
         at com.sapportals.wcm.portal.service.KMServiceImpl.afterInit(KMServiceImpl.java:215)
         at com.sapportals.portal.prt.core.broker.PortalServiceItem.__initServiceInstanceStep2(PortalServiceItem.java:867)
         at com.sapportals.portal.prt.core.broker.PortalServiceItem.startServices(PortalServiceItem.java:1081)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.startLoadOnStartupServices(PortalAppBroker.java:1563)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.start(PortalAppBroker.java:1518)
         at com.sapportals.portal.prt.core.broker.PortalAppBroker.startNonCoreApplications(PortalAppBroker.java:1469)
         at com.sapportals.portal.prt.runtime.Portal.init(Portal.java:406)
         at com.sapportals.portal.prt.core.PortalCoreInitializer.coreInit(PortalCoreInitializer.java:54)
         at com.sapportals.portal.prt.dispatcher.PortalInitializer.<init>(PortalInitializer.java:129)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$doSetupPortalInitializer.run(Dispatcher.java:161)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.initDispatcher(Dispatcher.java:359)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.access$000(Dispatcher.java:42)
         at com.sapportals.portal.prt.dispatcher.Dispatcher$InitRunner.run(Dispatcher.java:114)
         at com.sapportals.portal.prt.dispatcher.Dispatcher.init(Dispatcher.java:392)
         at com.sap.engine.services.servlets_jsp.server.runtime.context.WebComponents.addServlet(WebComponents.java:138)
         at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.loadServlets(ApplicationThreadInitializer.java:376)
         at com.sap.engine.services.servlets_jsp.server.container.ApplicationThreadInitializer.run(ApplicationThreadInitializer.java:110)
         at com.sap.engine.core.thread.impl3.ActionObject.run(ActionObject.java:37)
         at java.security.AccessController.doPrivileged(Native Method)
         at com.sap.engine.core.thread.impl3.SingleThread.execute(SingleThread.java:100)
         at com.sap.engine.core.thread.impl3.SingleThread.run(SingleThread.java:170)

    Have you checked to see if Apache is running?

  • How can I use MS Windows 7 Task Scheduler to start Cisco Jabber?

    Hello Jabber community,
    I have a need to automatically start Cisco Jabber client on my Desktop and have it connect to a SIP address of our CTX, then followed by the running of a recording application. The problem is I don't know the Jabber CLI to use to start it up and connect to the SIP address.
    Can anyone please advise how to do this?
    cheers,
    -guy                  

    Hi Guy,
    I think you should probably open up a TAC case and get the TAC engineer to walk you through how to deploy Jabber.
    When you say "SIP url", I presume you mean the CUPS/Webex server address. This address can be added to Jabber in 3 ways:
    1. Transforming the MSI using the Orca tool.
    2. Using msi install parameters
    3. Entering the value when you run Jabber first.
    Using a bat file in conjunction with task scheduler will not work and is not a supported way of doing. The 3 other options are also much easier to implement.
    Thanks,
    - Colin

  • Task Scheduling Script - Need help with passing the scheduled command (variables are not being evaluated)

    Hi Everyone,
    I'm trying to get a simple task scheduler script to work for me and can't get the command I need passed to the scheduler to evaluate properly.
    Here's the script:
    ###Create a new task running $Command and execute it Daily at 6am.
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $Command = 'winscp.com /command "option batch abort" "option confirm off" "open $Proto://$User:$Pwd@$Server" "put $NetworkDir $RemoteDir" "exit"'
    $TaskAction = New-ScheduledTaskAction -Execute "$Command"
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"
    What's messing up is the $Command creation, the command needs to have the quotes around "option blah blah", but if I wrap the whole line in single quotes the variables that are evaluated for the "open blah blah" strings (which also need
    to be inside quotes) and the "put blah blah" string are not being evaluated properly.
    I've dorked about with different bracketing and quoting but can't nail the syntax down, could someone point me in the right direction? My Google-fu seems to be lacking when it comes to nailing down this issue.
    Thanks

    Hmmn, closer. I'm getting this error now:
    + $Command = $tmpl -f  $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        + CategoryInfo          : InvalidOperation: (winscp.com /com...t {4} {5}" exit:String) [], RuntimeException
        + FullyQualifiedErrorId : FormatError
    And the command being added to the new task looks like this:
    winscp.com /command "option batch abort" "option confirm off" "open ($Proto)://($User):($Pwd)@($Server)" "put $NetworkDir $RemoteDir" "exit"
    Here's the current state of the script. I get what you're doing to try to bypass the quotes issue, using an array. I'm just not awesome at this yet sooooooo...
    $TaskName = Read-Host 'What would you like this job to be named?'
    $Proto = Read-Host 'What is the protocol? (FTP/FTPS/SFTP)'
    $User = Read-Host 'What is the user name?'
    $Pwd = Read-Host 'What is the password?'
    $Server = Read-Host 'What is the server address?'
    $NetworkDir = Read-Host 'Please input the network location of the file(s) you wish to send. Refer to documentation for more details.'
    $RemoteDir = Read-Host 'Please input the REMOTE directory to which you will upload your files. If there is none please input a slash'
    $tmpl = 'winscp.com /command "option batch abort" "option confirm off" "open {0}://{1}:{2}@{3}" "put {4} {5}" exit'
    $Command = $tmpl -f $User, $Pwd, $Server, $NetworkDir, $RemoteDir
    $TaskAction = New-ScheduledTaskAction -Execute $Command
    $TaskTrigger = New-ScheduledTaskTrigger -Daily -At 6am
    Register-ScheduledTask -Action $TaskAction -Trigger $Tasktrigger -TaskName "$TaskName" -User "Administrator" -RunLevel Highest
    Write-Host "$TaskName created to run Daily at $TaskStartTime"

  • Task Scheduler UI crashes upon launch

    Hello,
    Last week, a customer called to report that her workstation was not booting. Long story short: There was a problem with the hard drive. I cloned the drive to a new disk and that brought the system back up. 
    While looking for damage after the clone, I noticed that the Task Scheduler UI does not launch. Specifically, if you open "Task Scheduler" from the Start menu, nothing appears. If you access the Task Schedule from Computer Management, Computer
    Management closes unexpected. (The same thing happens when you add-in the Task Scheduler to a new MMC.)
    To be sure, this problem could pre-date the hard drive problem. I really don't know.
    I have no reason to believe that task scheduling isn't working. The service runs and I've scheduled a task from the command line successfully. But, admittedly, the loss of user-friendliness is kind of a big deal to the end user. 
    The only evidence I've been able to track down so far is that with each crash, the Application Log shows
    EventID 1023: 
    .NET Runtime version 2.0.50727.5477 - Fatal Execution Engine Error (000007FEF80C54F6) (80131506)
    What I've tried:
    1. I've run the dotnet repair tool from Microsoft which found problems with 4.5 and repaired them.
    2. I ran SFC which reported it found problems and fixed them.
    3. I've tried known-good copies of Tasksched.msc.
    4. I've cleared out both the Tasks folder and the cache in the registry to see if a particular entry was causing the crash. No difference. 
    What am I missing?
    Cheers,
    m

    Hi,
    What’s the result after you run this repair tool?
    Microsoft .NET Framework Repair Tool
    http://www.microsoft.com/en-us/download/details.aspx?id=30135
    check if you can apply this hotfix:
    FIX: The top of the call stack shows the mscorwks!WKS::gc_heap::mark_object_simple function after an exception occurs in a .NET Framework 2.0-based application
    http://support.microsoft.com/kb/974372
    Alex Zhao
    TechNet Community Support

  • Executing powershell scripts via Task Scheduler

    Hi,
    I have a powershell script that I wrote that when executed from the shell works fine but when executed from task scheduler does not work.
    In my script, an email is sent out based on the results of the execution.  When I run this from the shell, email goes out, when scheduled, no email and there is no indication of errors having occurred anywhere in the system.
    Has anyone run into a similar issue?
    I did change my powershell execution policy to be unrestricted (both in the x86 and x64 consoles).  I am running Windows 2008 R2.
    Thanks - Greg.

    Hi,
    In addition the above suggestions, please also refer to the below threads:
    Using Task Scheduler for a powershell script on server 2008
    http://social.technet.microsoft.com/Forums/en-US/ITCG/thread/e298d613-47b8-4492-92d1-0b55cc8497c1
     Using Windows Task Scheduler to execute Powershell Script frequently
    http://social.technet.microsoft.com/Forums/en-US/winserverpowershell/thread/5901a6ad-ba18-4817-82a9-f75d2d6b439f
    Hope this helps.
    Best Regards,
    Yan Li
    Yan Li
    TechNet Community Support

  • Script doesn't work in task scheduler

    I know it has already posted many times but I have already tried everything and still I can't get it to work.
    The script is a simple send email function and it works if executed from the command prompt:
    powershell.exe -f .\sendEmail.ps1 [email protected] "Test Subject" "Test Message"
    But in the task scheduler it doesn't work and no email is sent. The exit code of the task is 0xFFFD0000:
    Task Scheduler successfully completed task "\SendEmailTest" , instance "{15ff2070-ee25-4b2e-9ae1-274eda0d8c3a}" , action "powershell.exe" with return code 4294770688.
    The task is configured to run under the SYSTEM account with highest privilege, powershell ist configured with unrestricted execution policy, why it doesn't work?
    I have tried also with a simpler task to create a text file
    New-Item c:\scripts\new_file.txt -type file -force -value "This is text added to the file"
    But it doesn't work too, so it should be some other missing privilege somewhere but I couldn't find anything in internet.
    Thanks for any help

    I found another possible issue while looking at a similar problem. I was unable to execute a PowerShell script as a Task Scheduler action, even though the script ran correctly when logged into Windows as the target user and running within PowerShell.
    Task Scheduler would consistently display the 0xFFFD0000 error when I nominated the script in the task's action arguments using what I believed to be normal PowerShell quoting rules:
    -ExecutionPolicy Bypass -File 'D:\full path\to\script.ps1'
    PowerShell acquiesced and Task Scheduler fired off the task immediately and without issue when I changed the quotes I used from single to double:
    -ExecutionPolicy Bypass -File "D:\full path\to\script.ps1"
    Dropping to a command prompt and executing the full command immediately revealed the problem:
    D:\>C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -ExecutionPolicy Bypass -File 'D:\full path\to\script.ps1'Processing -File ''D:\full path\to' failed: The given path's format is not supported. Specify a valid path for the -File parameter.
    Notice the strange use of two single quotes before the path and one single quote after.
    The moral of the story: When feeding the full path of a script to PowerShell as a command line parameter,
    use double quotes!

  • VBS objshell.AppActivate doesn't work with Windows Task Scheduler

    Hi all,
    This script do the following : 
    Open Adobe Flash media Live Encoder with an encoding profile
    Activate the Adobe Flash... Window
    Send enter key to start encoding
    Set objShell = WScript.CreateObject( "WScript.Shell" )
    objShell.Run """C:\Program Files (x86)\Adobe\Flash Media Live Encoder 3.2\FlashMediaLiveEncoder.exe"" /p ""C:\Users\process\AppData\Roaming\Adobe\Flash Media Live Encoder 3.2\profile.xml"""
    'Loading time
    WScript.Sleep 5000
    objshell.AppActivate ("Adobe Flash Media Live Encoder 3.2")
    WScript.Sleep 5000
    objShell.SendKeys "{ENTER}" 'start encoding
    This script perfectly works manually, but the objshell.appactivate command doesn't work when i run it with the windows task Scheduler.
    Any ideas ? Thx

    Hi to all! I have found workaround for this issue - I wrote vbs, made run it via bat file, and converted the bat file to exe
    vbs
    Set oShell = CreateObject("WScript.Shell")
    If oShell.AppActivate ("Connecting error to Bee") Then
    WScript.Sleep 2000
    oShell.SendKeys "%{F4}"
    End If
    bat
    start C:\Users\User\Desktop\close.vbs
    bat to exe
    Advanced BAT to EXE Converter v2.83
    I know it's some weird solution but it is working with Win Task Scheduler correctly. Try it ;)
    In some cases you need to mark checkbox "run this program as an administrator" and (or not) disable UAC.

  • Task Scheduler PS1 with convertto-html and send-mailmessage doesn't deliver HTML, works in E201SP2RU5 EMS

    When I run the script below from EMS it's delivered with the expect HTML table. but if I run it from a task in task scheduler the html is missing.
    I've tried launching it in Task scheduler a couple different  ways with the same results.  This is what I'm using now:
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -ServerFqdn exchange.domain.com; C:\scripts\TESTER.PS1"
    Any ideas?
    =========================
    $a = "<style>"
    $a = $a + "BODY{background-color:White;}"
    $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $a = $a + "TH{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:LightSteelBlue}"
    $a = $a + "TD{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:Linen}"
    $a = $a + "</style>"
    $MBexportBatchRprt = Get-MailboxExportRequest -ResultSize unlimited -BatchName Test-Batch |
        sort name | Get-MailboxExportRequestStatistics |
        select Name,PercentComplete,status,StartTimestamp,CompletionTimestamp,OverallDuration, EstimatedTransferSize, EstimatedTransferItemCount, BadItemsEncountered |
        ConvertTo-Html -Head $a |
        Out-String
    $messageParameters = @{                       
        Subject = "Report 1"                       
        Body = "Contact [email protected] with problems. <br/><br/> $MBexportBatchRprt"
        From = "[email protected]"                       
        To = "[email protected]"                       
        SmtpServer = "exchange.domain.com"                       
    Send-MailMessage @messageParameters -BodyAsHtml 
    =========================

    When I run the script below from EMS it's delivered with the expect HTML table. but if I run it from a task in task scheduler the html is missing.
    I've tried launching it in Task scheduler a couple different  ways with the same results.  This is what I'm using now:
    C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -command ". 'C:\Program Files\Microsoft\Exchange Server\V14\bin\RemoteExchange.ps1'; Connect-ExchangeServer -ServerFqdn exchange.domain.com; C:\scripts\TESTER.PS1"
    Any ideas?
    =========================
    $a = "<style>"
    $a = $a + "BODY{background-color:White;}"
    $a = $a + "TABLE{border-width: 1px;border-style: solid;border-color: black;border-collapse: collapse;}"
    $a = $a + "TH{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:LightSteelBlue}"
    $a = $a + "TD{border-width: 1px;padding: 5px;border-style: solid;border-color: black;background-color:Linen}"
    $a = $a + "</style>"
    $MBexportBatchRprt = Get-MailboxExportRequest -ResultSize unlimited -BatchName Test-Batch |
        sort name | Get-MailboxExportRequestStatistics |
        select Name,PercentComplete,status,StartTimestamp,CompletionTimestamp,OverallDuration, EstimatedTransferSize, EstimatedTransferItemCount, BadItemsEncountered |
        ConvertTo-Html -Head $a |
        Out-String
    $messageParameters = @{                       
        Subject = "Report 1"                       
        Body = "Contact [email protected] with problems. <br/><br/> $MBexportBatchRprt"
        From = "[email protected]"                       
        To = "[email protected]"                       
        SmtpServer = "exchange.domain.com"                       
    Send-MailMessage @messageParameters -BodyAsHtml 
    =========================

  • My speaker doesn't work when I try to listen to music or open up a quick time file, however they seem to work perfectly when I listen to a voice memo (p.s. the volume slider disappears in a song page and even in the multi tasking bar)

    my speaker doesn't work when I try to listen to music or open up a quick time file, however they seem to work perfectly when I listen to a voice memo (p.s. the volume slider disappears in a song page and even in the multi tasking bar)

    Thanks for your solution, it wasn't quite what solved the problem but i remembered that i had a bit of salt water on my phone recently and spraying the charging port with an anti-oxide spray solved my problem, do you mind if i ask, how is the charging port related with the volume or/and speakers?

  • In human task, dynamically assign group doesn't work

    Oracle SOA 11.1.1.4
    My bpel process invokes a human task.
    On the human task Assignment tab, I assigned 3 users (by name), 1 group (by expression).
    The group is configured in LDAP
    When I tested the bpel process, I entered the group and other data required.
    From the worklist app, I see the task listed. It is assigned to the 3 users, but not the dynamically passed-in group.
    From the Audit trail, I saw all data I entered (include the group). Everything seems correct, but I still can’t make the dynamically-pass-group work.
    If I assign the group by name in human task, it works fine.
    The problem is: dynamically assign group doesn't work.
    Please kindly advice.

    Yes, it is possible assign a group as participant of some human task, passing the group name as parameter.
    I have tested just now.
    It works pretty well in SOA 11.1.1.4 (BPEL or BPM).
    Make sure add a data parameter in your human task definition and pass a valid group name to it.
    At the Assignment tab, in the participants' list, add a group, data type by expression, and set the value to the right xpath expression to the corresponding parameter.
    For example: /task:task/task:payload/task:group
    If it is not working look the SOA log files, probably you'll find some information about the error there. Maybe there is some problem with your jazn.com configuration.
    You can also test if there is something wrong related to the group name, trying to transfer some task to the same group by the worklist.

Maybe you are looking for

  • Should I upgrade to CS5 on 3-year old pc?

    HP Pavilion d5000t desktop pc. I currently have CS4 Prod Premium on the 64-bit Windows 7. 8 GB Ram DDR2 (max) Core 2 Quad Q9450 2.66 GHz processor. Graphics card GeForce 9600 GS. I work with HDV footage I have no plans to purchase a new computer any

  • Printing my PDF with File name and Tags Stamped on

    To Forum, Possibly not a completely Apple related query, but if anyone know it would be great. id like to print a PDF on my MBP with the File name and Tags applied to it stamped on the paper copy... or come to think of it, stamped on the PDF copy whi

  • Trinidad and ADF Rich Faces components::

    Hi! Does someone know about any problem while using Trinidad and ADF Rich Faces, or just the Trinidad components in JDev11g ? Thanx. Endy

  • My iPod touch, fourth gen, will not charge or be recognized by computer.

    My iPod touch, fourth gen, wont charge or be recognized by my computer. This computer has worked with my iPod before and the wall charger also works. But when i plugged it into the wall charger it didn't work. I tried a different cable and tried my c

  • Converting Unix Date in Query

    <p>Hello everybody,</p><p> </p><p>i connect with brio 8.5 to a SQL database and get the unixdate.Is there a function or anything to convert this to the normaldate?</p><p>Or which formular can do this for me. Thank you inadvance.</p><p> </p>