Sometimes we have very complicated apps we have to deploy and need to view the application dependency tree to help investigate failed deployments. I found the built in view in the SCCM console clunky, buggy and annoying. So I wrote a small script to query WMI, list app dependencies and then output this visually using graphviz dot language.
The first thing the script does is query all the apps on your site server WMI for a search term. It then displays a list of applications in a grid view. You then choose which Application you want to create a dependency graph for. Once you have chosen one, the script will recurse through all the dependencies and build a graph.
It’s still in its infancy, it doesn’t highlight AND / OR relations and may have some redundant code that needs tiding up… But I find it useful to demonstrate to support staff why some applications take a while to deploy due to the complexity and amount of pre-reqs required!
- Install graphviz for windows from here
- Add an entry in your PATH environment varibale to the location of dot.exe – on Windows 10 for me it was : “C:\Program Files (x86)\Graphviz2.38\bin”
- Download the script from Github Gist Here
- Edit the variables in the script
- $server – should be the management point server with the WMI Provider for your SCCM Site
- $sitecode – should be the sitecode for your site
- $graph_filetype – filetype of the output (I’ve only tested png, svg and pdf so far…)
- $query – should be an application search string, the first thing the script will do is search and list the applications found using this. You can then choose which app you want to see the dependency tree for.
- Run the script!
- You should get two output files in the output directory
- AppName.(pdf/png/svg – depending on selected output filetype)