cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
lres
Engaged Sweeper
Hi there, would like primary and secondary DNS settings for all pcs and servers in domain. Thanks. The code below providers all Servers, but need users PCs as well Thanks.

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress As LastScannedIP,
tsysIPLocations.IPLocation As CurrentIPLocation,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetwork.Description As Adapter,
tblNetwork.IPAddress,
tblNetwork.IPSubnet,
tblNetwork.DNSServerSearchOrder
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblAssetCustom.State = 1 And tblComputersystem.Domainrole > 1 And
tblNetwork.IPEnabled = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
Adapter
4 REPLIES 4
Esben_D
Lansweeper Employee
Lansweeper Employee
The report does not show history. Your assets might have multiple network adapters which have different settings. If you go to the asset's page and navigate to the Config\Network\Network tab, you can see all the scanned network items for that asset.
MikW
Engaged Sweeper II
This is showing duplicate entries even though all properties are the same except DNSServerSearchOrder. I don't know if this report is showing historical data but is there any way to show only current?

I have 4 different lines and DNS is diferent in each of them.
lres
Engaged Sweeper
Thanks much! Worked like a charm. Sorry, pretty new at this.
mlachance
Engaged Sweeper III
The following syntax is limiting the report to show servers only.
tblComputersystem.Domainrole > 1
To show all user computers and servers, simply remove that from your code.

The fixed report looks like this (line 23 was changed):

Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.IPAddress As LastScannedIP,
tsysIPLocations.IPLocation As CurrentIPLocation,
tblAssets.Firstseen,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblNetwork.Description As Adapter,
tblNetwork.IPAddress,
tblNetwork.IPSubnet,
tblNetwork.DNSServerSearchOrder
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Left Join tsysIPLocations On tsysIPLocations.StartIP <= tblAssets.IPNumeric
And tsysIPLocations.EndIP >= tblAssets.IPNumeric
Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
Where tblAssetCustom.State = 1 And tblNetwork.IPEnabled = 1
Order By tblAssets.Domain,
tblAssets.AssetName,
Adapter