LSComputerObjectQuery.txt

USE lansweeperdb
Select Top 1 tblAssets.AssetID,
  tblAssetCustom.Branchoffice,
  tblAssetCustom.Building,
  tblComputersystem.CurrentTimeZone,
  tblAssetCustom.Custom1,
  tblAssetCustom.Custom2,
  tblAssetCustom.Custom3,
  tblAssetCustom.Custom4,
  tblAssetCustom.Custom5,
  tblAssetCustom.Custom6,
  tblAssetCustom.Custom7,
  tblAssetCustom.Custom8,
  tblAssetCustom.Custom9,
  tblAssetCustom.Custom10,
  tblAssetCustom.Custom11,
  tblAssetCustom.Custom12,
  tblAssetCustom.Custom13,
  tblAssetCustom.Custom14,
  tblAssetCustom.Custom15,
  tblAssetCustom.Custom16,
  tblAssetCustom.Custom17,
  tblAssetCustom.Custom18,
  tblAssetCustom.Custom19,
  tblAssetCustom.Custom20,
  tblComputersystem.DaylightInEffect,
  tblNetwork.DefaultIPGateway,
  tblAssetCustom.Department,
  tblNetwork.Description As NetConfigDescription,
  tblNetwork.DHCPenabled,
  tblNetwork.DHCPserver,
  tblNetwork.DNSDomain,
  tblAssetCustom.DNSName,
  tblCPlogoninfo.Domain As LastUserLogonDomain,
  tblAssets.Domain,
  tblAssets.FQDN,
  tblAssetCustom.HardwareVersion,
  tblComputersystem.Infraredsupported,
  tblAssets.IPAddress,
  tblNetwork.IPSubnet,
  tblAssets.LastActiveScan,
  tblAssetCustom.LastFullbackup,
  tblAssetCustom.LastPatched,
  tblAssets.LastScheduled,
  tblAssets.Lastseen,
  tblAssets.Lasttried,
  tblAssetCustom.Location,
  tblCPlogoninfo.logontime,
  tblNetworkAdapter.MACaddress As MAC,
  tblNetworkAdapter.Manufacturer As NICManufacturer,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tblNetworkAdapter.Name As NICName,
  tblComputersystem.NumberOfLogicalProcessors,
  tblComputersystem.NumberOfProcessors,
  tblAssets.OScode,
  tblComputersystem.PartOfDomain,
  tblComputersystem.PowerOnPasswordStatus,
  tblAssets.Processor,
  tblProxy.Proxyportnumber,
  tblProxy.Proxyserver,
  tblAssetCustom.PurchaseDate,
  tblAssets.Scanserver,
  tblAssetCustom.Serialnumber As DeviceSerial,
  tblAssets.SP As ServicePack,
  tblAssetCustom.SystemSKU,
  tblComputersystem.SystemType,
  tblComputersystem.TotalPhysicalMemory,
  tblAssets.Uptime,
  tblAssets.Userdomain,
  tblAssets.Username,
  tblAssetCustom.Warrantydate
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
  Inner Join tblCPlogoninfo On tblAssets.AssetID = tblCPlogoninfo.AssetID
  Inner Join tblNetwork On tblAssets.AssetID = tblNetwork.AssetID
  Inner Join tblNetworkAdapter On tblAssets.AssetID = tblNetworkAdapter.AssetID
  Full Join tblProxy On tblAssets.AssetID = tblProxy.AssetID
Where tblAssets.AssetID = @AssetID
Order by logontime Desc