Automatic Deployment Rule – Upate ID Translation

If you’ve ever worked with Automatic Deployment Rules, at some point an update has failed to download. While you might be familiar with the RuleEngine.log file, did know the “updateID” is the “CI_ID”? If you’ve ever tried to find a software update via CI_ID, you know you’re going to one of two places, and neither of them is the console. Essentially, if you’re here you’re looking for an easy way to figure out what update caused this error:

For those of you who already know what this is and just want the quick answer here you go:

PowerShell

#Enter the site code here
$siteCode = "XYZ"
#Enter the CI ID
$ciID = "11111111"
Get-CimInstance -ClassName SMS_SoftwareUpdate -Namespace "root\SMS\site_$($SiteCode)" -Filter "CI_ID = $($ciID)" | Select-Object LocalizedDisplayName,DateCreated

SQL Query

--Where XXXXX is the update ID from the logs with an error

SELECT * FROM v_UpdateInfo WHERE CI_ID = 'XXXXXX'
--or for more strategic data

SELECT dbo.v_UpdateInfo.CI_ID
	, dbo.v_UpdateInfo.ArticleID
	, dbo.v_UpdateInfo.Title
	, dbo.v_UpdateInfo.CI_UniqueID
	, dbo.v_UpdateInfo.InfoURL
FROM v_UpdateInfo WHERE CI_ID = 'XXXXX'

What’s this error mean?

In this scenario, the ADR has failed because it was unable to download content an example error for this might be:

Failed to download ContentID 16778383 for UpdateID 16779809. Error code = 404

While this might be a pretty simple error (Can’t download the content, content not found, cause I deleted it) – what’s not clear is the name of the update causing the issue, and trying to determine the name of the update from a series of numbers might be frustrating.

Getting Update Info with PowerShell

If you’ve worked with Configuration Manager for any length of time then you know it’s all WMI at the end of the day. In this case, software updates and their information exist within the Site Namespace, and have a class called “SMS_SoftwareUpdate”. You can actually retrieve all of the updates, and their associated properties by just requesting the objects that are of type SMS_SoftwareUpdate. This is pretty simple to get using the below line. When you do this, make sure you update line with your site code. This is pretty neat as you can get a lot of general information about software updates directly via PowerShell.

PowerShell

Get-CimInstance -ClassName SMS_SoftwareUpdate -Namespace "root\SMS\site_DM6"
Results of getting SMS_SoftwareUpdate

If we take a close look you can see the CI_ID field here which of course means you can filter on it as was done in the example at the top of the article, so in this case we could run:

#Enter the site code here
$siteCode = "XYZ"
#Enter the CI ID
$ciID = "16779809"
Get-CimInstance -ClassName SMS_SoftwareUpdate -Namespace "root\SMS\site_$($SiteCode)" -Filter "CI_ID = $($ciID)" | Select-Object LocalizedDisplayName,DateCreated

With this we get the below output which includes the date the update was created, and the name of the update causing the issue.

Getting Information with SQL

We can also get this information from SQL. Fortunately the SQL information is a little more transparent in my opinion, because CI_ID is the primary key which is used in a lot of locations across the Configuration Manager Database. For this use case it’s the primary key in the view

v_UpdateInfo

If we run a select * from this view we will find all of the pieces we need for this particular puzzle, and from there we can create the SQL query like we did above to find out the name of the update which was causing this issue.

I hope this was helpful and let me know if you want more tips like this.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: