Hi Guys, need your help. I created group in SCOM and want to assign powershell script monitor to that group. The script itself works when i assign in to class Windows Computers, but doesnt working for a group. Im quite new in SCOM, might do something wrong. Any help would be very useful. Thanks in advance.
Hi Yvi, and welcome to the community!
Groups don’t really work as most people expect them to in SCOM, and (with some exceptions) you don’t normally ask them to do the monitoring. Mostly they are used for health rollups and organization purposes.
The group is run by the management group and all processes related to the group are run by the management server that happens to be looking after the group at the time. So the script will run on the management server and not on the agents of the computers in the group.
In this scenario, a better approach is to make a new class for those computers and target the monitor to that class instead. That way the monitor will be targeted at the agents looking after the computers and the script will run where you expect.
Kevin Holman has a number of examples of creating custom classes in a variety of scenarios, here’s two that I found quickly along these sorts of lines:
If you’re new to SCOM and getting into custom monitoring I would highly recommend following through the Management Pack Authoring course on Microsoft Learn:
Don’t let the SCOM version put you off, very little has changed around the core monitoring piece since 2012 R2. To this day I think this is one of the most valuable SCOM resources I have found!
Hope this helps!
Thank you very much An_Evil_Penguin for hint, that is really helpful.