I think you are looking for one of two things: 1) The user account under which the task was created - in which case use Task.Definition.RegistrationInfo.Author or 2) The user account under which the task runs - in which case use Task.Definition.Principal.ToString() (which will pull either UserId or GroupId property based on logon type).
↧