cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Sramm
Engaged Sweeper II
I am working on compiling a report listing teamviewer ID's from windows assets. Different versions of teamviewer store the ClientID in different registry keys. I've added all the possible locations to the custom registry scan locations. I've also found a report which works, however it only scans one possible registry key location.

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Firstseen,
SubQuery1.Value As [TeamViewer ID],
tblAssets.Domain,
tblAssets.Description,
tblAssets.Username
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\Wow6432Node\Teamviewer' And
tblRegistry.Valuename = 'ClientID') SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And TsysWaittime.CFGname = 'registry'
Order By tblAssets.Domain,
tblAssets.AssetName


I've tried multiple ways to implement an OR statement into the
.RegKey Like '%SOFTWARE\Wow6432Node\Teamviewer'
segment, but haven't been able to find anything that works.

Essentially, I need the Teamviewer ID pulled from the ClientID RegKey (which has the possibility to reside in ~ 10 locations) and, regardless of where it came from, posted to the 'Teamviewer ID' field.

If anyone could point me in the right direction I'd be very thankful.
3 REPLIES 3
Sramm
Engaged Sweeper II
I've got it work.. kind of.

Per your instruction I added the second registry key location as a second subquery. However, in order to pull the results from that query into my report, I had to add a second Column for the results of subquery 2, as it wouldn't let me set both SubQuery1.Value & SubQuery2.Value as [TeamViewer ID].

This works but is less than optimal, Is there a way to pull the value of multiple subquery's into the same Column? For Refrence the following is my report thus far. (I'm only using 2 of the 12 possible regkey locations right now for testing)

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Firstseen,
SubQuery1.Value As [TeamViewer ID],
SubQuery2.Value As [TeamViewer ID1],
tblAssets.Domain,
tblAssets.Description,
tblAssets.Username
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\Wow6432Node\Teamviewer' And
tblRegistry.Valuename = 'ClientID') SubQuery1 On SubQuery1.AssetID =
tblAssets.AssetID
Left Join (Select Top 1000000 tblRegistry.AssetID,
tblRegistry.Regkey,
tblRegistry.Valuename,
tblRegistry.Value,
tblRegistry.Lastchanged
From tblRegistry
Where
tblRegistry.Regkey Like '%SOFTWARE\Teamviewer' And
tblRegistry.Valuename = 'ClientID') SubQuery2 On SubQuery2.AssetID =
tblAssets.AssetID
Where tblAssetCustom.State = 1 And TsysWaittime.CFGname = 'registry'
Order By tblAssets.Domain,
tblAssets.AssetName
Sramm
Engaged Sweeper II
Thank you Charles!

I'll give that a shot and let you know how it goes.
Esben_D
Lansweeper Employee
Lansweeper Employee
Just mentioned it in a different topic, so some copy/paste from there

If you want multiple registry keys in the same report you will need to create a subquery for each registry key. Here is and example which you should be able to copy paste into your report and edit the paths/values.

 Left Join (Select Top 1000000 tblRegistry.AssetID,
tblRegistry.Regkey,
tblRegistry.Valuename,
tblRegistry.Value,
tblRegistry.Lastchanged
From tblRegistry
Where
tblRegistry.Regkey Like
'%SOFTWARE\Microsoft\Windows NT\CurrentVersion' And
tblRegistry.Valuename = 'ReleaseId') SubQuery2 On SubQuery2.AssetID =
tblAssets.AssetID

New to Lansweeper?

Try Lansweeper For Free

Experience Lansweeper with your own data.
Sign up now for a 14-day free trial.

Try Now