For every consulting project I do one of the requirements is documentation. I like to provide more documentation than required, which is why I give my SCOM clients a general How To document if they are new to SCOM. I also provide documentation on the SCOM Distributed Applications we have created in the environment.
This script was born out for that reason, as well as for creating Visio based dashboards in SquaredUp. To create Visio dashboards you need the SCOM Object ID so that SquaredUp knows where to link the Visio Object to for Health status within SCOM. Getting the SCOM Objects of one or two items might not be a big deal, but when you have 30+ Distributed Applications each with multiple components and each component having more than one object, this adds up quickly.
The original version of this script just exported the information to separate CSV files and I took the time to “make it pretty” in excel to deliver it to the client.
Now, Powershell does it for me.
First, what this script is: A script that attempts to grab all your Distributed Applications, their components and objects in the DA components.
What it is not: a full SCOM environment documentation script.
Also if you have a SCOM Group inside a SCOM Group inside a DA Component, the script will only go one level deep on the first SCOM Group.
The script accepts parameters -scom and -credential, which are required.
The script will also accept optional parameters -saveandclose (boolean) -path (string) -filename (string). If you use the SaveandClose parameter you need to fill out the path and filename or it will fail to save.
All commands are executed remotely. Excel is obviously required. The account you specify needs to have remote Powershell access to the SCOM environment.
How to run the script
Here are some examples of running the script with parameters
If you don’t specify credentials it will prompt for your credentials
Here is example output from my SCOM Lab.
The main sheet where all Distributed Applications will be put with their Management Pack and SCOM Object ID.
Example outputs of my two DA’s.
And finally, GIF capture of it running.
The script has been tested in a production environment with approximately 88 distributed applications. In this instance the script took about 10 minutes to run.
Definitely test it in your lab first. Use at your own risk. The script does not modify any data in your environment, its only getting data. However, it will put load on your SDK service for each call it makes.
Tested on SCOM 2016 and 1801 and Excel 2016. It should work in SCOM 2012 R2, if you try it and it does work please let me know.
Currently working on a github repository for it, for now you can download the script here