‎05-07-2017 07:50 AM
Select Distinct Top 1000000 a.AssetID,
a.AssetUnique,
d.Image As icon,
c.Manufacturer,
c.Model As Model,
SubString(c.Serialnumber, 1, 15) As Serial#,
a.Processor As CPU,
f.NumberOfProcessors As Sockets,
f.NumberOfLogicalProcessors As LCP,
Ceiling(a.Memory / 1024) As RAM,
Sum(Cast(Cast(b.Size As bigint) / 1024 / 1024 / 1024 As numeric)) As
[HDD Size],
d.OSname As OS,
a.IPAddress As IP,
Replace(Replace(Replace(Replace(e.OU, 'OU=Computers,', ''), ',DC=amgdom,',
''), 'DC=com', ''), 'OU=', '') As Department,
e.Description As Rack,
a.Lastseen
From tblAssets a,
tblADComputers e,
tblDiskdrives b,
tblAssetCustom c,
tsysOS d,
tblComputersystem f
Where a.AssetID = b.AssetID And b.AssetID = c.AssetID And a.OScode = d.OScode
And a.AssetID = e.AssetID And b.AssetID = e.AssetID And a.AssetID = f.AssetID
And (a.IPAddress Like '192.168.100.%' Or a.IPAddress Like '192.168.101.%' Or
a.IPAddress Like '10.100.3.%' Or a.IPAddress Like '10.100.4.%' Or
a.IPAddress Like '192.168.115.%' Or a.IPAddress Like '172.17.1.%' Or
a.IPAddress Like '172.17.2.%' Or a.IPAddress Like '172.17.3.%' Or
a.IPAddress Like '172.17.4. %') And f.Domainrole > 1 And c.State = 1
Group By a.AssetID,
a.AssetUnique,
d.Image,
c.Manufacturer,
c.Model,
a.Processor,
f.NumberOfProcessors,
f.NumberOfLogicalProcessors,
d.OSname,
a.IPAddress,
e.Description,
a.Lastseen,
a.Memory,
c.Serialnumber,
e.OU
Order By Rack,
Model,
IP
Solved! Go to Solution.
‎05-08-2017 10:46 AM
Select Distinct Top 1000000 a.AssetID,
a.AssetUnique,
d.Image As icon,
c.Manufacturer,
c.Model As Model,
SubString(c.Serialnumber, 1, 15) As Serial#,
a.Processor As CPU,
f.NumberOfProcessors As Sockets,
f.NumberOfLogicalProcessors As LCP,
Ceiling(a.Memory / 1024) As RAM,
Sum(Cast(Cast(b.Size As bigint) / 1024 / 1024 / 1024 As numeric)) As
[HDD Size],
tblOperatingsystem.Caption As OS,
tblOperatingsystem.Version As [OS Version],
a.IPAddress As IP,
Replace(Replace(Replace(Replace(e.OU, 'OU=Computers,', ''), ',DC=amgdom,',
''), 'DC=com', ''), 'OU=', '') As Department,
e.Description As Rack,
a.Lastseen
From tblAssets a
Inner Join tblOperatingsystem On a.AssetID = tblOperatingsystem.AssetID,
tblADComputers e,
tblDiskdrives b,
tblAssetCustom c,
tsysOS d,
tblComputersystem f
Where a.AssetID = b.AssetID And b.AssetID = c.AssetID And a.OScode = d.OScode
And a.AssetID = e.AssetID And b.AssetID = e.AssetID And a.AssetID = f.AssetID
And (a.IPAddress Like '192.168.100.%' Or a.IPAddress Like '192.168.101.%' Or
a.IPAddress Like '10.100.3.%' Or a.IPAddress Like '10.100.4.%' Or
a.IPAddress Like '192.168.115.%' Or a.IPAddress Like '172.17.1.%' Or
a.IPAddress Like '172.17.2.%' Or a.IPAddress Like '172.17.3.%' Or
a.IPAddress Like '172.17.4. %') And f.Domainrole > 1 And c.State = 1
Group By a.AssetID,
a.AssetUnique,
d.Image,
c.Manufacturer,
c.Model,
a.Processor,
f.NumberOfProcessors,
f.NumberOfLogicalProcessors,
tblOperatingsystem.Caption,
tblOperatingsystem.Version,
a.IPAddress,
e.Description,
a.Lastseen,
a.Memory,
c.Serialnumber,
e.OU
Order By Rack,
Model,
IP
‎05-08-2017 10:46 AM
Select Distinct Top 1000000 a.AssetID,
a.AssetUnique,
d.Image As icon,
c.Manufacturer,
c.Model As Model,
SubString(c.Serialnumber, 1, 15) As Serial#,
a.Processor As CPU,
f.NumberOfProcessors As Sockets,
f.NumberOfLogicalProcessors As LCP,
Ceiling(a.Memory / 1024) As RAM,
Sum(Cast(Cast(b.Size As bigint) / 1024 / 1024 / 1024 As numeric)) As
[HDD Size],
tblOperatingsystem.Caption As OS,
tblOperatingsystem.Version As [OS Version],
a.IPAddress As IP,
Replace(Replace(Replace(Replace(e.OU, 'OU=Computers,', ''), ',DC=amgdom,',
''), 'DC=com', ''), 'OU=', '') As Department,
e.Description As Rack,
a.Lastseen
From tblAssets a
Inner Join tblOperatingsystem On a.AssetID = tblOperatingsystem.AssetID,
tblADComputers e,
tblDiskdrives b,
tblAssetCustom c,
tsysOS d,
tblComputersystem f
Where a.AssetID = b.AssetID And b.AssetID = c.AssetID And a.OScode = d.OScode
And a.AssetID = e.AssetID And b.AssetID = e.AssetID And a.AssetID = f.AssetID
And (a.IPAddress Like '192.168.100.%' Or a.IPAddress Like '192.168.101.%' Or
a.IPAddress Like '10.100.3.%' Or a.IPAddress Like '10.100.4.%' Or
a.IPAddress Like '192.168.115.%' Or a.IPAddress Like '172.17.1.%' Or
a.IPAddress Like '172.17.2.%' Or a.IPAddress Like '172.17.3.%' Or
a.IPAddress Like '172.17.4. %') And f.Domainrole > 1 And c.State = 1
Group By a.AssetID,
a.AssetUnique,
d.Image,
c.Manufacturer,
c.Model,
a.Processor,
f.NumberOfProcessors,
f.NumberOfLogicalProcessors,
tblOperatingsystem.Caption,
tblOperatingsystem.Version,
a.IPAddress,
e.Description,
a.Lastseen,
a.Memory,
c.Serialnumber,
e.OU
Order By Rack,
Model,
IP
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now