4

I have a few timer jobs which I cannot delete. Using Get-SPTimerJob I am able to find the jobs and the GUIDS, but when I try to delete them I receive the following error:

PS C:\Windows\system32> $job = Get-SPTimerJob -id a066a06c-513b-4fe4-a557-a36b420da7e6
PS C:\Windows\system32> $job.Delete()
Exception calling "Delete" with "0" argument(s): "Object reference not set to an instance of an object."
At line:1 char:12
+ $job.Delete <<<< ()
+ CategoryInfo          : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : DotNetMethodException

I then tried stsadm.exe in case the SP Snap-in console wasn't functioning properly.

PS C:\Windows\system32> stsadm.exe -o deleteconfigurationobject -id  a066a06c-513b-4fe4-a557-a36b420da7e6
Object reference not set to an instance of an object.

I have stopped and restarted the owstimer, tried this with both the timer started and stopped, but all without success. I am running PS with Admin privileges.

7
  • Might seem like a simple question, but are you sure $job is set to something (i.e. the timer job you think you are getting)? If that Get-SPTimerJob command is not returning a job, then $job.Delete() won't work. I am assuming that is not the case but it might be worth a try to doublecheck that $job is contains an actual timer job instance.
    – lwbecker2
    Commented Mar 20, 2014 at 16:35
  • try this one...i am sure their is nothing like -id rather identity......$job = Get-SPTimerJob "jobName or GUID" -WebApplication webApplicationName $job.Delete()
    – Waqas Sarwar MVP
    Commented Mar 20, 2014 at 17:29
  • lwbecker - $job returned one: Name Schedule Last Run ---- -------- -------- solution-deployme... 1/1/0001 12:00:00 AM Waqas - This is a wsp deployment to the Front-end Web server so there's no specific application Commented Mar 20, 2014 at 18:05
  • 1
    If OP's object was null they'd get $job.delete() You cannot call a method on a null-valued expression. Commented Mar 20, 2014 at 18:57
  • 1
    In looking into the issue it appears that the SPTimerServiceInstance object may not be working. I tried a script I found in a MS KB support.microsoft.com/kb/2616609/de which didn't solve the issue. No timer jobs are running even if the SPTimerV4 service is running. WSP deployments from days ago aren't working, and I can't delete them without the Object error. Commented Mar 20, 2014 at 19:02

1 Answer 1

1

It appears that after a server restore a few weeks back the SP server had become disconnected in part from the SQL Server.

We found a solution: We disconnected from the server farm, then we went back through the SP Wizard and reconnected to the existing configuration Database. This gave us a new Central Admin site, but now our timer jobs are working properly. All content was preserved since we connected to the existing one. This process to reconnect took about 20 minutes.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.