Lansweeper

[Lansweeper]Workstations less than 2.0 GB free on System Drive (with username and display name)

Select Top 1000000 tblAssets.AssetID,
tblAssets.AssetUnique,
tsysOS.OSname,
tblAssets.Description,
tblDiskdrives.Caption,
Cast(Cast(tblDiskdrives.Freespace As bigint) / 1024 / 1024 As numeric) As
free,
Cast(Cast(tblDiskdrives.Size As bigint) / 1024 / 1024 As numeric) As
[total size],
tblDiskdrives.Lastchanged As [last changed],
tsysOS.Image As icon,
tblAssets.Username,
tblADusers.Displayname
From tblAssets
Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID
Inner Join tblOperatingsystem
On tblAssets.AssetID = tblOperatingsystem.AssetID
Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID
Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
Inner Join tsysOS On tblAssets.OScode = tsysOS.OScode
Inner Join tblADusers On tblAssets.Username = tblADusers.Username
Where tblDiskdrives.Caption = ‘C:’ And Cast(Cast(tblDiskdrives.Freespace As
bigint) / 1024 / 1024 As numeric) < 2048 And Cast(Cast(tblDiskdrives.Size As
bigint) / 1024 / 1024 As numeric) <> 0 And tblComputersystem.Domainrole < 2
And tblDiskdrives.DriveType = 3 And tblAssetCustom.State = 1
Order By tblAssets.AssetUnique

Advertisements

[Lansweeper] Report of unclean Reboot (Event ID 41) of last 14 days

Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.Displayname,
tblAssets.OScode,
tblNtlog.Eventcode,
Max(tblNtlog.TimeGenerated) As LastOccurrence,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message
From tblAssets
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblNtlogSource.Sourcename Like ‘%kernel%’ And tblNtlog.Eventcode = 41
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblADusers.Displayname,
tblAssets.OScode,
tblNtlog.Eventcode,
tblNtlogSource.Sourcename,
tblNtlogMessage.Message
Having Max(tblNtlog.TimeGenerated) > GetDate() – 14
Order By LastOccurrence Desc,
tblAssets.AssetName

[Lansweeper] Report of hard disk with bad sector

Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblNtlog.Eventcode,
Max(tblNtlog.TimeGenerated) As LastOccurrence,
tblADusers.Displayname,
tblNtlogMessage.Message
From tblAssets
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblNtlogMessage.Message Like ‘%Harddisk0%’ And tblNtlog.Eventcode = 7
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblNtlog.Eventcode,
tblADusers.Displayname,
tblNtlogMessage.Message,
tblAssets.OScode
Order By tblAssets.AssetName

[Lansweeper] Report of Microsoft Office 2010 SP1

Select Top 1000000 upgrade_tblComputers.Computername,
upgrade_tblComputers.ComputerUnique,
upgrade_tblSoftware.softwareName,
upgrade_tblSoftware.softwareVersion,
tblADusers.Displayname,
tblADusers.Username
From upgrade_tblComputers
Inner Join upgrade_tblSoftware On upgrade_tblComputers.Computername =
upgrade_tblSoftware.ComputerName
Left Join tblADusers On upgrade_tblComputers.Username = tblADusers.Username
And upgrade_tblComputers.Userdomain = tblADusers.Userdomain
Where upgrade_tblSoftware.softwareName Like ‘Microsoft Office%’
AND upgrade_tblSoftware.softwareVersion Between ‘14.0.6029.1000’ AND ‘14.0.7015.1000’

Order By upgrade_tblComputers.ComputerUnique

Information of software version is based on the following link:

http://support.microsoft.com/kb/2121559

[Lansweeper] Report of all active printers

Select Top 1000 tblAssets.AssetName,
tblAssets.AssetID,
tblAssets.IPAddress,
web40repprinterstatus.Status,
web40repprinterstatus.[DeviceĀ  model],
tblAssets.Mac,
tblAssets.LastIPScan,
tblAssets.Lastseen,
tblAssets.Firstseen,
tblAssets.Lasttried
From tblAssets
Inner Join web40repprinterstatus On tblAssets.AssetID = web40repprinterstatus.AssetID
And tblAssets.Assettype = 16

[Lansweeper] Report of hard disk error

Select Distinct Top 1000000 tblAssets.AssetID,
tblAssets.AssetName,
tblNtlog.Eventcode,
tblNtlogSource.Sourcename,
Max(tblNtlog.TimeGenerated) As LastOccurrence,
tblADusers.Displayname,
tblAssets.OScode,
tblNtlogMessage.Message
From tblAssets
Inner Join tblNtlog On tblAssets.AssetID = tblNtlog.AssetID
Inner Join tblNtlogSource On tblNtlogSource.SourcenameID =
tblNtlog.SourcenameID
Inner Join tblNtlogMessage On tblNtlogMessage.MessageID = tblNtlog.MessageID
Left Join tblADusers On tblADusers.Username = tblAssets.Username And
tblADusers.Userdomain = tblAssets.Userdomain
Where tblNtlog.Eventcode In (57, 55, 51, 26, 16, 7) And
tblNtlogSource.Sourcename In (‘Disk’, ‘volsnap’, ‘Application Popup’, ‘Ntfs’)
Group By tblAssets.AssetID,
tblAssets.AssetName,
tblNtlog.Eventcode,
tblNtlogSource.Sourcename,
tblADusers.Displayname,
tblAssets.OScode,
tblNtlogMessage.Message
Order By tblAssets.AssetName

[Lansweeper] Report of computers without monitors

Select Top 10000 m.AssetID,
m.AssetName,
m.Username,
m.LastActiveScan,
m.IPAddress,
m.Description
From tblAssets As m,
upgrade_web40ActiveComputers As a
Where a.Computername = m.AssetID And — Filter out non-active computers
Not Exists(Select r.AssetID From tblMonitor As r Where r.AssetID = m.AssetID) And — Filter out computers with monitors
Not Exists(Select e.AssetID From web50repallscanningerrors As e Where e.AssetID = m.AssetID) — Filter out scan error PC
Order By m.LastActiveScan Desc

— a for Active Computer
— m for main assets
— r for relationship
— e for errorscan