cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
francisswest
Champion Sweeper
While reviewing https://mdtguy.wordpress.com/, I came across the most recent post, which has a registry key for the date and timestamp of the most recent MDT deployment.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Deployment 4\Deployment Timestamp

Curious if this time stamp could be parsed and a report built to show when assets were deployed? Would be nice to see asset name and deployment date at the very least, with the timestamp parsed out properly. From there I could probably customize it a bit more.

This would be a nice way of getting a build date for folks machines, so we could plan rebuilds a bit better.

Thoughts?
1 ACCEPTED SOLUTION

NVM, Got it sorted thanks to some AI.  Here is the script as I am using it now:

Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Username,
  Convert(datetime,SubString(SubQuery1.Value, 1, 😎 + ' ' +
  SubString(SubQuery1.Value, 9, 2) + ':' + SubString(SubQuery1.Value, 11, 2) +
  ':' + SubString(SubQuery1.Value, 13, 2)) As [Last Rebuild/Deployment],
  tblAssets.IPAddress,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  TsysLastscan.Lasttime As LastRegistryScan,
  Case
    When SubQuery1.Valuename Is Not Null And SubQuery1.Valuename <> ''
    Then 'Yes'
    Else 'No'
  End As ValuenameFound,
  SubQuery1.Lastchanged
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Inner Join TsysLastscan On tblAssets.AssetID = TsysLastscan.AssetID
  Inner Join TsysWaittime On TsysWaittime.CFGCode = TsysLastscan.CFGcode
  Left Join (Select Top 1000000 tblRegistry.AssetID,
      tblRegistry.Regkey,
      tblRegistry.Valuename,
      tblRegistry.Value,
      tblRegistry.Lastchanged
    From tblRegistry
    Where tblRegistry.Regkey Like '%SOFTWARE\Microsoft\Deployment 4' And
      tblRegistry.Valuename = 'Deployment Timestamp') SubQuery1 On
      SubQuery1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1 And TsysWaittime.CFGname = 'registry'
Order By tblAssets.Domain,
  tblAssets.AssetName

 

The end result looks like this:

francisswest_0-1700684582950.png

 

View solution in original post

3 REPLIES 3
francisswest
Champion Sweeper

I realize this is definitely an old thread, but Im curious if there is a way to further clean the report.  The end result of grabbing the date isnt as...beautiful as I am hoping.  Heres an example:

francisswest_0-1700666911859.png

Is there an easy way in my report to make that "Value" a bit more legible/searchable?

NVM, Got it sorted thanks to some AI.  Here is the script as I am using it now:

Select Top 1000000 tsysOS.Image As icon,
  tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Username,
  Convert(datetime,SubString(SubQuery1.Value, 1, 😎 + ' ' +
  SubString(SubQuery1.Value, 9, 2) + ':' + SubString(SubQuery1.Value, 11, 2) +
  ':' + SubString(SubQuery1.Value, 13, 2)) As [Last Rebuild/Deployment],
  tblAssets.IPAddress,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  TsysLastscan.Lasttime As LastRegistryScan,
  Case
    When SubQuery1.Valuename Is Not Null And SubQuery1.Valuename <> ''
    Then 'Yes'
    Else 'No'
  End As ValuenameFound,
  SubQuery1.Lastchanged
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
  Inner Join TsysLastscan On tblAssets.AssetID = TsysLastscan.AssetID
  Inner Join TsysWaittime On TsysWaittime.CFGCode = TsysLastscan.CFGcode
  Left Join (Select Top 1000000 tblRegistry.AssetID,
      tblRegistry.Regkey,
      tblRegistry.Valuename,
      tblRegistry.Value,
      tblRegistry.Lastchanged
    From tblRegistry
    Where tblRegistry.Regkey Like '%SOFTWARE\Microsoft\Deployment 4' And
      tblRegistry.Valuename = 'Deployment Timestamp') SubQuery1 On
      SubQuery1.AssetID = tblAssets.AssetID
Where tblAssetCustom.State = 1 And TsysWaittime.CFGname = 'registry'
Order By tblAssets.Domain,
  tblAssets.AssetName

 

The end result looks like this:

francisswest_0-1700684582950.png

 

Esben_D
Lansweeper Employee
Lansweeper Employee
Step 1 would be scanning the value of this registry key. We have a knowledgebase article which covers how to do this: https://www.lansweeper.com/kb/18/report-based-on-registry-keys.html

Also linked in that knowledgebase article is a example report of how to create a report with the scanned registry key. Here is the link in case you missed it: https://www.lansweeper.com/Forum/yaf_postst10451_Value-of-a-value-name-submitted-for-custom-registry-scanning.aspx#post39295