Task scheduler says task ran successfully but task doesnt run

0 comments

Posted on 25th July 2013 by Mike in Windows 2008 |Windows 2008 R2

, , , , ,

Hi,

We had a task that executed a custom powershell on several servers. It was working fine on all but one server. The task was the exact same on every server. The scheduler said the task completed successfully but when ran manually it was “successful” in less than a couple of seconds.

The action we were executing looked like this:
taskscheduler

Again this worked fine on other servers but one server it didnt work on.

To fix we gave the action the full path to powershell.exe:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
taskscheduler

BITS 0x800704DD in Powershell Script as Scheduled Task windows 2008 R2

1 comment

Posted on 16th May 2013 by Mike in Windows 2008 R2

, , , ,

Hello All,

I was stumped for a while on this one. I wrote a powershell script to backup databases and use BITS to transfer them over the network. It worked great in an elevated powershell but when I went to automate the script using a scheduled task I kept getting this error when it got to the bits xfer:

Start-BitsTransfer : The operation being requested was not performed because the user has not logged on to the network. The specified service does not exist.
(Exception from HRESULT: 0x800704DD)

There are several good explanations for the cause:
An Explanation of UAC and BITS
Dale Qiao’s Solution got me started
Issues With BITS (List of Errors and Why)

So what the hell is the solution?

In my case I needed an account that was a SQL sysadmin and a server admin. I used the task scheduler to run the tasks as the ‘system’ account.

1. Click Start Menu/Programs/Accessories/System Tools/Task Scheduler
2. On the General tab click Change User or Group
3. Make sure “Select this object type” contains “Built-in security principal” and “From this location” contains the computer name.
4. In the “Enter the object name to select” type “SYSTEM” and click OK
5. Select “Run with highest privileges”