→ 🚀What's New? Join Us for the Fall Product Launch! Register Now !
‎11-28-2014 01:33 PM
Select Top 1000000 tsysOS.Image As icon,
tblAssets.AssetID,
tblAssets.AssetName,
tblAssets.Domain,
tblADComputers.OU,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
tblAssetCustom.Serialnumber,
tsysOS.OSname,
tblOperatingsystem.Caption As FullOSname,
tblAssets.SP,
tblAssets.Username,
tblAssets.Userdomain,
tblAssets.Lastseen,
tblAssetCustom.PurchaseDate,
tblWarrantyDetails.WarrantyStartDate,
tblWarrantyDetails.WarrantyEndDate,
tblWarrantyDetails.ServiceType
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tsysOS.OScode = tblAssets.OScode
Inner Join tblOperatingsystem On tblOperatingsystem.AssetID =
tblAssets.AssetID
Left Join tblWarranty On tblAssets.AssetID = tblWarranty.AssetId
Inner Join tblWarrantyDetails On tblWarranty.WarrantyId =
tblWarrantyDetails.WarrantyId
Left Join tblADComputers On tblAssets.AssetID = tblADComputers.AssetID
Where
(tblADComputers.OU Like 'OU=Computers,OU=UK,DC=Some,DC=company,DC=com')
Or
(tblADComputers.OU Like
'OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU Like
'OU=WLAN,OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')
Solved! Go to Solution.
‎12-02-2014 03:39 PM
Select Top 1000000 tblAssets.AssetName,
tblAssets.IPAddress,
tblADComputers.OU,
tblADComputers.Lastchanged,
tblAssets.Username,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.AssetID
From tblADComputers
Inner Join tblAssets On tblAssets.AssetID = dbo.tblADComputers.AssetID
Where
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win8,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Mac,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Misc,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Tablets,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Test,OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=RTest,OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Rooms,OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Offline,OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Rooms,OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=1234,OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com'))
Order By tblAssets.AssetName
‎12-02-2014 03:39 PM
Select Top 1000000 tblAssets.AssetName,
tblAssets.IPAddress,
tblADComputers.OU,
tblADComputers.Lastchanged,
tblAssets.Username,
tblAssets.Lastseen,
tblAssets.Lasttried,
tblADComputers.AssetID
From tblADComputers
Inner Join tblAssets On tblAssets.AssetID = dbo.tblADComputers.AssetID
Where
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win8,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Mac,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Misc,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Tablets,OU=Computers,OU=UK,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Test,OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=RTest,OU=Win7,OU=Computers,OU=UK,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Rooms,OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=Offline,OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=FR,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com')) Or
(tblADComputers.OU =
'OU=Rooms,OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com') Or
(tblADComputers.OU =
'OU=1234,OU=Win7,OU=Computers,OU=US,DC=Some,DC=company,DC=com'))
Order By tblAssets.AssetName
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now