I’ve created a display using the PowerShell Grid Tile. This tile setup must be re-used on every application dashboard.
The design leverages PowerShell to pull vulnerability information from Tenable.SC within the context of a SCOM group.
The only thing that ever needs to be changed for this script to work is the group scope, and between environments, the SCOM connection must be changed.
This lends itself to creating our own custom Tile for it, but I can’t see if this is even possible, it looks as though only dashboards and persepectives may be created.
I believe you can achieve what you need using perspectives.
Perspectives can be built on top of objects, groups, or classes, and can utilise properties from these types, including the members of a group. This is referenced in the script using a the scope in the script.
See “Scope options on perspectives” on the above page for the options from perspectives.
A perspective is a drill down, but to make it into a dashboard, you can pin the perspective, which then allows sharing using open access.
This isn’t quite what I am after, I do not believe. While it is rather simple to create a perspective, I need about 200 instances of this perspective applied to about 200 groups, and using the members of that group in the script (the $scope). This seems to put me in the same conundrum that I started in - I need to create the perspective for every group from scratch. This is also a tile in a dashboard, and while I am not averse to adding a perspective tab, what I want is to re-use the same code over and over, but only change the group name in any single SquaredUp deployment. That way, if I make an update/change to the script that pulls the desired data from the source, I only need to change the code in one place.
The goal is to create it once, and re-use it without copy/pasting it.
EDIT: To be clear, I am not displaying the members of the group at all. I am using the members of that group as a list to query the REST API, and returning the results formatted in a PowerShell (Grid) tile. This is re-used currently in the context of about 200 SCOM groups, so every time I make a change to the script, I have to paste the updated script or the JSON for the tile into another dashboard about 200 times, changing the name of the group.
EDIT: Also, this could not apply to all groups. It can only apply to groups containing Windows Computers or UNIX/Linux Computers.
A perspective can target the class Group, effectively displaying on all groups. The script itself would then use the dynamic scope from the group you are viewing at that point in time.
The only downside is that it would appear on all groups, but you are able to suppress perspectives. You could script the creation of the perspectives, inserting the group IDs as required, so they only target the correct groups. The only thing to remember is that each perspective ID needs to be different, but this is easily achieved with new-guid
This isn’t an ideal solution, but it’s somewhere close to where you want to be, with less effort than creating 200 scripts/dashboards.
Right. So, we’ve come full circle to the subject of the thread, creating a custom tile. The ideal solution here would be the ability to create a custom tile, which would contain my script, and could be inserted into any dashboard, with the only configuration being the group to target to get the $scope, and the PowerShell environment to use.
Or even just the group, since in any singular instance of SquaredUp, the environment would always be the same.
Scripting the creation of the perspectives is intriguing though. Is there documentaion/examples of this capability?
I’m not aware of any examples of perspective JSON, but you can view the JSON on any dashboard/perspective/tile you create by dropping to edit mode and clicking the </> icon.
As I mentioned before, the only thing that must be unique is the ID. Adding a new dashboard or perspective will give you the basis of each of these items. There’s also the draft setting (true/false IIRC), which will define if it’s available to all users.
“You could script the creation of the perspectives, inserting the group IDs as required, so they only target the correct groups.”
I’m intimately familiar with the SquaredUp json, and often edit it for my own novel purposes.
I’m looking for specific examples and documentation of “script the creation of the perspectives, inserting the group IDs as required, so they only target the correct groups” - that is, how does one script the creation of the perspectives to only apply them to the correct groups"?
To script the creation, you’d use PowerShell/Terraform/whatever automation tool you’re familiar with (SCORCH was used by one customer!), to insert the group ID you’re interested in.
I’m not aware of any documented examples in the wild I’m afraid.