→ Having trouble accessing our new support portal or creating a ticket? Please notify our team here

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
gelbersupport
Engaged Sweeper
I am looking to generate a weekly report of hosts that will be purged from lansweeper (per the asset cleanup options) within the next week or so. I am not sure what criteria needs to be met in order for an asset to be eligible for deletion (we have the value set to 20 days of not being seen, then delete) but the end result is I'd like to be notified via a report of the hosts that are in danger of being removed.
1 ACCEPTED SOLUTION
stahly8
Engaged Sweeper III
here is what i use for 30 days. you could change the 30 to something like 15 for 15 days.


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tsysOS.OSname,
tblAssets.Lastseen As [Last Seen],
tsysOS.Image As icon,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
TsysChassisTypes.ChassisName As Type,
tblAssets.Username
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Inner Join TsysChassisTypes On tblSystemEnclosure.ChassisTypes =
TsysChassisTypes.Chassistype
Where tblAssets.Lastseen < GetDate() - 30 And tblAssetCustom.State = 1
Order By [Last Seen] Desc,
tblAssets.AssetName

View solution in original post

1 REPLY 1
stahly8
Engaged Sweeper III
here is what i use for 30 days. you could change the 30 to something like 15 for 15 days.


Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tblAssets.Domain,
tsysOS.OSname,
tblAssets.Lastseen As [Last Seen],
tsysOS.Image As icon,
tblAssetCustom.Manufacturer,
tblAssetCustom.Model,
TsysChassisTypes.ChassisName As Type,
tblAssets.Username
From tblAssets
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblSystemEnclosure
On tblAssets.AssetID = tblSystemEnclosure.AssetID
Inner Join TsysChassisTypes On tblSystemEnclosure.ChassisTypes =
TsysChassisTypes.Chassistype
Where tblAssets.Lastseen < GetDate() - 30 And tblAssetCustom.State = 1
Order By [Last Seen] Desc,
tblAssets.AssetName