none
Powershell script failed to run - SCOMpercentageCPUTimeCounter.ps1 RRS feed

  • Question

  • Getting tons of alerts in SCOM 2016 for Power Shell Script failed to run and this script.

    Alert Description:

    The PowerShell script failed with below exception

    System.Management.Automation.ActionPreferenceStopException: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The client cannot connect to the destination specified in the request. Verify that the service on the destination is running and is accepting requests. Consult the logs and documentation for the WS-Management service running on the destination, most commonly IIS or WinRM. If the destination is the WinRM service, run the following command on the destination to analyze and configure the WinRM service: "winrm quickconfig".At line:106 char:15
    + ... $checker = Get-CimInstance -ComputerName $ComputerName -Namespace "r ...
    + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    at System.Management.Automation.Runspaces.PipelineBase.Invoke(IEnumerable input)
    at Microsoft.EnterpriseManagement.Common.PowerShell.RunspaceController.RunScript[T](String scriptName, String scriptBody, Dictionary`2 parameters, Object[] constructorArgs, IScriptDebug iScriptDebug, Boolean bSerializeOutput)

    Script Name: SCOMpercentageCPUTimeCounter.ps1

    Research I've done says this was a bug that was fixed with UR4. However, we are on UR7 and it does not seem to be fixed. I also found this addendum MP that someone did to resolve this issue before UR4 came out.... https://gallery.technet.microsoft.com/SCOM-2016-System-Center-1611d6c8/view/Discussions#content. Tried importing it but it said I didn't have the dependent MP I needed. Tried to install that and it said it's already installed.

    So I'm really at a loss as to how to resolve this other than disable the rule entirely, which I do not want to do. Does anyone have any up to date information on this issue that seems to have existed for quite some time?


    Kenny

    Wednesday, October 2, 2019 2:41 PM

All replies

  • Hi Kenny,

     

    Based as I know, if you have an HTTP/serverfqdn SPN registered for service account, you may see this error.  Removing the SPN should resolve the errors, however that may also break other apps that require it. a potential work around is to register the SPN by port. The following article for your reference:

    https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/register-a-service-principal-name-for-kerberos-connections?view=sql-server-2017

     

    Hope it can help!

     

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Friday, October 4, 2019 1:34 AM
  • We do not have a HTTP/serverfqdn SPN registered for our Scom servers.

    Kenny

    Friday, October 4, 2019 9:32 PM
  • Hi Kenny,

     

    Thanks for your update.

     

    Meanwhile, Could you also confirm if the SPN is not under the action account either?

     

    Thanks and I look forward to your reply.

     

    Best regards.

    Crystal

     


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 7, 2019 9:11 AM
  • Checked and there are no HTTP SPN's for this. Any other ideas?

    Kenny

    Tuesday, October 8, 2019 7:57 PM
  • may be the issue came from WINRM. Please refer to https://docs.microsoft.com/en-us/windows/win32/winrm/installation-and-configuration-for-windows-remote-management?redirectedfrom=MSDN on Installation and Configuration for Windows Remote Management.
    Moreover, some Windows Server 2016 blocked WinRM processes. You may created a GPO to enable WinRM with domain controller Group Policy for WMI monitoring.https://support.auvik.com/hc/en-us/articles/204424994-How-to-enable-WinRM-with-domain-controller-Group-Policy-for-WMI-monitoring

    Roger
    Wednesday, October 9, 2019 2:08 AM
  • Hi Kenny,

    Besides Roger's suggestion, we can also try to run the affected command which is in the error message to see if it can run successfully to clarify the issue:

    Get-CimInstance -ComputerName $ComputerName -Namespace "r ...

    Note: Change the value to the specific one in your environment.

    If there's any update, please let us know.

    Best regards.

    Crystal


    Wednesday, October 9, 2019 9:00 AM
  • I don't really know that much about WINRM but as far as I can tell it is enabled and configured correctly. The command you wanted me to run is cut off in the error message...

    Get-CimInstance -ComputerName $ComputerName -Namespace "root\cimv2...

    If I run it as is it prompts for ClassName. Don't know what to put there.

    The only alerts we are getting for Powershell script failed to run are for SCOMpercentageCPUTimeCounter.ps1. Seems unlikely that this one particular has WINRM or other requirements that are not exposed anywhere else. Rather, it seems to be a bug. That's what was identified in the past and there are numerous references all over the internet of that being resolved by UR4, which does not appear to be true.


    Kenny

    Wednesday, October 9, 2019 6:00 PM
  • Hi Kenny,

    Thanks for your update.  I will build an environment with SCOM 2016 UR7 to see if the same issue exists. And will update here.

    Thanks for your understanding and have a nice day.

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.


    Thursday, October 10, 2019 6:47 AM
  • Hi Kenny,

     

    This  is Crystal again, I have built an environment with UR7 and found the same issue as yours.  Then I try to upgrade to UR8 and will keep monitoring. If there’s any update, will post back to let you know.

     

    Thanks and have a nice day.

     

    Best regards.

    Crystal

     


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Tuesday, October 15, 2019 7:08 AM
  • Hi Kenny,

    Tested in UR8, the same issue, I have sent feedback to our Product team. Hope it can be fixed in the future version

    Meanwhile, you can also submit the issue in our feedback website:

    https://systemcenterom.uservoice.com/forums/293064-general-operations-manager-feedback

    Thanks for your understanding and have a nice day.

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Thursday, October 17, 2019 5:49 AM
  • Thanks so much for investigating.

    What I've done for now is set overrides to disable the following:

    Target: Health Service

    Monitor:Agent processor utilization

    Rule: Collect agent processor utilization

    That seems to have done the trick.


    Kenny

    Friday, October 18, 2019 9:51 PM
  • Hi Kenny,

     

    Thanks for your update. Disable the monitor can be a temp option to stop the alert generating. Meanwhile, if I get any update from our Product team. I will also post back.

     

    Thanks and have a nice day!

     

    Best regards.

    Crystal


    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact tnmff@microsoft.com.

    Monday, October 21, 2019 5:56 AM