PowerShell Script Monitor - Operation Manager Cmdlet

Fursel 341 Reputation points
2022-04-14T10:36:25.587+00:00

Recently upgraded from SCOM 2016 to 2019 and I see some powershell monitors are not working anymore.
Looks like that Operation manager powershell module is not loaded when running script .

When logged to Management Server which is running the script on the action account which supposing run this script I can run SCOM Cmdlets without issue but when checking same commands via SCOM task from console I have error that term is not recognized.
e.g Get-SCOMClass : The term 'Get-SCOMClass' is not recognized as the name of a
cmdlet, function, script file, or operable program. Check the spelling of the
name, or if a path was included, verify that the path is correct and try again.

Running scom task from console "get-modules -listavailable" also doesn't return me Operation Manager module in the list but it does when I am logged in Management Server on action account.

Anyone has some idea how to solve this ?

Operations Manager
Operations Manager
A family of System Center products that provide infrastructure monitoring, help ensure the predictable performance and availability of vital applications, and offer comprehensive monitoring for datacenters and cloud, both private and public.
1,435 questions
0 comments No comments
{count} vote

Accepted answer
  1. Simon Ren-MSFT 31,446 Reputation points Microsoft Vendor
    2022-04-15T01:29:35.14+00:00

    Hi @Fursel ,

    Thanks very much for your feedback. We're glad that the question is solved now. It's appreciated that you could click "Accept Answer" to the helpful reply, this will help other users to search for useful information more quickly. Here's a short summary for the problem.

    Problem/Symptom:
    After upgraded from SCOM 2016 to 2019, some powershell monitors are not working anymore. Looks like that Operation manager powershell module is not loaded when running script .

    Solution/Workaround:
    Copying OperationsManager module to default Module path fixes the issue.

    Thanks again for your time! Have a nice day!

    Best regards,
    Simon


    If the response is helpful, please click "Accept Answer" and upvote it.
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Fursel 341 Reputation points
    2022-04-14T10:45:55.457+00:00

    Well I copied OperationsManager module to default Module path and it started to work then :/

    1 person found this answer helpful.
    0 comments No comments