question

Fursel avatar image
1 Vote"
Fursel asked SimonRenMSFT-3639 edited

PowerShell Script Monitor - Operation Manager Cmdlet

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 ?

msc-operations-manager
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

SimonRenMSFT-3639 avatar image
0 Votes"
SimonRenMSFT-3639 answered SimonRenMSFT-3639 edited

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.




5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Fursel avatar image
1 Vote"
Fursel answered

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

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.