We have an application that we have instrumented with WMI, and have added a WMI method which is a ManagementTask
. When we try to invoke this management task from another application the method is getting called just fine, however within that thread of execution we are trying to write to a file, send a command to the SCM, and perform debug logging. None of these three items will execute because they seem to be running into permissions problems.
When we try to write to a file we get the error
Either a required impersonation level was not provided, or the provided impersonation level is invalid.
How do we resolve this?