Hi all, is there a possibility to execute a powershell rule locally on the MS ? I have seen something in a post by Kevin Holman, but it was not exactly targeted to PowerShell.
Thanks
Hi all, is there a possibility to execute a powershell rule locally on the MS ? I have seen something in a post by Kevin Holman, but it was not exactly targeted to PowerShell.
Thanks
Have you heard of the PowerShell Authoring MP?
https://cookdown.com/scom-essentials/powershell-authoring/
Create the rule using this MP, target the Windows Computer class, ensure it’s disabled by default. Enable it only for your management servers.
Hi Dimitri, hope all is well.
This is possible, we do this for collecting shutdown events and to put them into maintenance mode.
There are two parts that are important here in our example.
// Jonas
OpsLogix / Approved
Thanks Jelly, of course I am using that MP, but I did not think about enabling it just for MS ?
I will try and let you know
Great to hear! It’s saved me a few times now
Seems not working. My problem is that I have to read an entry in eventlog on any monitored server and execute an action on the MS. If the rule is disabled it will never work.
Here https://kevinholman.com/2018/11/08/monitor-an-agent-but-run-response-on-a-management-server/ there was something but I cannot find a way to match this suggestion to my needs.
Ah I see, my suggestion will not suffice! Are you able to provide the script you’re using in your question?
Web-Applications-v1.1.zip (1.82 KB)
Web-Applications1.zip (1.81 KB)
Hi Jonas, it’s a long time indeed
Thanks for your suggestion. I will try to adapt this to my solution because I am not working with XML directly, but I create the rule in scom console using PowerShell MP. So if I understood correctly I should edit the MP once created to do the requested changes at code level. Did I understand correctly ?
The Event Collection rule can be created without the PowerShell MP. You just need to add a custom Write Action (WA) on the newly created rule and make sure it has the Management Servers on target. Not sure if the PowerShell MP can be used for creating the custom write action though.
So I have created a brand new MP based on Kevin Holman’s blog here… https://kevinholman.com/2018/11/08/monitor-an-agent-but-run-response-on-a-management-server/
I cannot paste the code here because the tags modify the page (the mysteries of XML )
And it does NOTHING…
It is imported correctly, And theorically it should work fine (I simply created an empty MP and added the code from Kevin).
I have no options right now.