cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
mmeetze
Engaged Sweeper III
I have a list that we pulled out of azure with hostnames, and I have created a comma separated list in hopes of being able to plug this list into a query here and generate the data needed. For us we are only wanting to capture the Model/OS/OS Version/LastSeen/LastScanned/AD Location for computer object.
7 REPLIES 7
RCorbeil
Honored Sweeper II
The "report" (query) is self-contained. You would need to open your CSV list in a text editor
AAA,BBB,CCC,DDD,EEE

reformat it to put single-quotes around the machine names
'AAA','BBB','CCC','DDD','EEE'

and copy/paste that between the parentheses in the query
WHERE
tblAssetCustom.State = 1
AND tblAssets.AssetName IN ('AAA','BBB','CCC','DDD','EEE')
RCorbeil
Honored Sweeper II
IN (list) works if you've got a list of possible values to compare against.
WHERE
tblAssetCustom.State = 1
AND tblAssets.AssetName IN ('AAA', 'BBB', 'CCC', 'DDD', 'EEE')
It's a shorthand version of
  tblAssetCustom.State = 1
AND (tblAssets.AssetName = 'AAA'
OR tblAssets.AssetName = 'BBB'
OR tblAssets.AssetName = 'CCC'
OR tblAssets.AssetName = 'DDD'
OR tblAssets.AssetName = 'EEE')
brandon_jones
Champion Sweeper III
Where would you put the path to the list? Would a csv file work?
mmeetze
Engaged Sweeper III
I am having some issues getting this to work properly and would love some advice. Here is my query

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tsysAssetTypes.AssetTypename,
tsysAssetTypes.AssetTypeIcon10 As icon,
tblAssets.IPAddress,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.Location,
tblAssets.OScode
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
Inner Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Where
tblAssets.AssetName =
'is like XXXXX,OR XXXXXX,OR XXXXXX,OR XXXXXXX,OR XXXXXXXX,OR XXXXXXX,OR XXXXXXXX,OR XXXXXX,OR mac0182273,OR XXXXXX'
And tblAssetCustom.State = 1


Now I have masked the hostnames above and shortened the list considerably, but is this the correct format that I am using? When I run it I get no results

brandon_jones
Champion Sweeper III
The only thing that I can think of is in the report do a where assetname like and enter the computer names there. Just make sure there is an or statement between each where statement.
mmeetze
Engaged Sweeper III
My first thought was just to leverage Lansweeper as well but this list was not derived from Lansweeper so there wasnt any queries setup. We are onboarding all machines into Azure and we have identified the machines and exported a list who are currently experiencing issues. So we need to gather the Models/OS Version and such as to begin the investigation as to why this is not successfully joining. Also this is not a small list, we have over 2K workstations that will need to be included in this particular report.
brandon_jones
Champion Sweeper III
Is this for all the computers in your network, or just certain ones? If it is only certain computers how did you decide which computers? Depending on what you used as your criteria, Lansweeper may be able to select just those computers and give you the information you need in a report.