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!
$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)
While running an OSD task sequence you can use powershell to check the TS Environment variables.
I added a ‘Pause’ step using this guide. If, like me, you are using an x64 PE image, you need use the ‘serviceui.exe’ from either the Program Files location on the machine with MDT installed, or a MDT package :
Have you ever wanted some information from the SCCM SQL DB, which you can access in the console but can’t find the data easily in the DB? Helpfully, all the data you access in the console is retrieved from the site server – which keeps a record of the queries.
Open the SCCM Console and access the data in the console, this can be loading a list of devices or even a status message query.
Look at the log file “SMSProv.log” located in %Program Files%\Microsoft Configuration Manager\Logs. You should be able to find the query that the site server ran to get the data.
I planned on publishing an article on how to use a log stored on the primary server to turn data you have queried in the SCCM console into an SQL query which can be used in Report Builder etc…
I drafted the beginning of this article in the middle of last year and didn’t get around to reviewing and finishing it until today. I had forgotten the location of the log required for this so googled it – and came across a blog post with all the information I planned to share – but with lots of screenshots and even instructions on using Report Builder.
So instead of re-inventing the wheel, I’ll link you to that excellent post instead!
Using System Center – Configuration Manager 2012 R2 we recently had some issues with routing, iscsi interfaces and content distribution. We needed to speed up distribution to a specific distribution point for some corrupt packages in order to get software installed at an Office in the Middle East.
So we needed the content to ‘jump’ the queue. There are no options in the SCCM Console to change DP priority order (that I have found), but luckily Microsoft have provided a way of doing it.
Note : As noticed by flatfour67 in the comments this may not work for DP’s assigned to secondary sites.
The following PoSH (Powershell) will list your Distribution Points and the Priority Assigned to them.
$dpinfo = Get-WmiObject -Query "SELECT NALPath, Priority, SiteCode, TransferRate, Description FROM SMS_DistributionPointInfo" -Namespace "ROOT\SMS\site_SITECODE" -ComputerName "MP_ServerName" | select NALPath, Priority, SiteCode, TransferRate
$dpinfo | Out-GridView
## Yes it could be done on one line, but I like doing it this way. After i have closed the GridView window i am still able to access the data without having to query WMI on the server again...
Default priority is 200, anything lower has a higher priority (content will be sent here first) and vice versa. Available values are 1 -> 300.