Sometimes it’s unclear what the error messages are when the SCOM Agent is running an VB or PowerShell script. Or the event-log messages say nothing about the issue you actually facing. In this situation the Tracing.cmd could give you more information what is happening.
How to start the SCOM Agent Tracing:
- Go to the Operations Manager Tools directory. Which is located: “C:\Program Files\Microsoft Monitoring Agent\Agent\Tools”
- Run: StopTracing.cmd
- Remove all the files located in the OpsMgr log folder: “C:\Windows\Logs\OpsMgrTrace”
- Run: StartTracing.cmd VER
- Wait till the problem reoccur, mostly an eventlog message that some script has runned.
- Run: StopTracing.cmd
- Format the logs in human readable information this can be done with the: FormatTracing.cmd
- The logs are saved in the log directory.
I used SMS Trace to debug the logs.
The issue was found in the “TracingGuidsManaged.log”. Invoke-WebRequest was running under a user account witch not have runned the “IE First time run setup”. You can change a group policy for this issue or simply run the step with the actual account.
Example debug line:
[3]dd/mm/yyyy [AzureModule] [] [Error] :RunspaceController.WriteErrorLine{runspacecontroller_cs412}( 0000000000)PowerShell Script ‘ps1’ WriteErrorLine: Invoke-WebRequest : The response content cannot be parsed because the Internet