question

LeonTaljaard-1502 avatar image
0 Votes"
LeonTaljaard-1502 asked LeonTaljaard-1502 commented

SCOM Command Channel not executing PowerShell Script

Hi Guys,

I am having an issue with a command channel that I have set up. I duplicated the settings from a working environment on a new SCOM 2019 deployment but its not working on the new SCOM.

The script works perfectly when run manually but it does not want to trigger from SCOM itself when an alert is triggered.

Below is the command channel

136906-capture1.png


msc-operations-manager
capture1.png (18.2 KiB)
· 3
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.

Is the subscription correct? (do you have the alert criteria correct, is it calling the command channel, etc.)
Are there any interesting errors in the management servers that are trying to run this script?
What happens if you try a simple shell script that just writes the arguments to a text file? (to make sure the arguments are getting passed correctly)

0 Votes 0 ·

Hi there,

Sorry for the late response but I actually checked the subscription and the issue was the criteria.

Thank you

0 Votes 0 ·

I cant seem to accept your answer

0 Votes 0 ·

1 Answer

RogerXue-3369 avatar image
0 Votes"
RogerXue-3369 answered LeonTaljaard-1502 commented

for the PowerShell script,

added the PS cmdlet 'New-SCOMManagementGroupConnection <management server>' to the script immediately after the OperationsManager module was imported.

You may refer to
https://social.technet.microsoft.com/Forums/en-US/5c0c51ec-1b0d-4684-ae45-7c6bcd035b82/scom-command-channel-using-powershell?forum=operationsmanagergeneral


Best Regard
roger

· 1
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.

Hi,

I have tried this already and it still doesn't work, its just not triggering it at all. I don't know what else to try, the script works perfectly when run manually.

138169-channelscript.png


0 Votes 0 ·
channelscript.png (27.7 KiB)