You can eliminate the Principal block and then use the parameters on the RegisterTaskDefinition method to set those values. The process must have appropriate permissions to connect to the TaskService. There are a number of articles on MSDN that detail what permissions are needed within the host process, when credentials should be provided when connecting to a TaskService instance, and what needs to be done within RegisterTaskDefinition.
↧