Problems running scripts using the service

Up until now I have been running Tentacle in interactive mode so I could see the messages. However, running in service mode is giving me errors with at least one script.

2011-10-06 14:01:43 DEBUG ERROR: You cannot call a method on a null-valued expression.
ERROR: At line:9 char:62
ERROR: + $Count = ($Server.JobServer.Jobs | Where { $.Name.StartsWith <<<< (“some
ERROR: thing__”) -and $
.IsEnabled } | Measure-Object).Count
ERROR: + CategoryInfo : InvalidOperation: (StartsWith:String) [], Runtim
ERROR: eException
ERROR: + FullyQualifiedErrorId : InvokeMethodOnNull
ERROR:

In this particular script I’m loading the SqlServer Smo assemblies and querying sql jobs. Seems to work fine on it’s own but not within the service.

Hi Nathan,

Since Tentacle runs as Local System it might be a permissions problem. Are you able to modify your script to output each value (using Write-Host) before piping it to the next command, and show me the output? It may be that because of permissions one of the commands is indeed returning null.

Paul