cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Gabriel-Chemie
Engaged Sweeper

Dear Community

We have lots of Servers with Unallocated Disk Space, and its very time consuming to manually check each Server,  whenever we need disk space for other VM's. Right now there is no community made, or Built in Report for this Function. Unallocated Space is not visible at all by LanSweeper. How can we visualize this within LanSweeper ?

1 ACCEPTED SOLUTION
Mister_Nobody
Honored Sweeper II

Try this:

 

Select Top (1000000) tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tblAssets.Lastseen As [Last successful scan],
  tblAssets.Lasttried As [Last scan attempt],
  tblVolume.Name As VolumeName,
  tblVolume.DriveLetter,
  tblVolume.Label As LogicalDiskName,
  Case tblVolume.DriveType
    When 0 Then 'Unknown'
    When 1 Then 'No Root Directory'
    When 2 Then 'Removable Disk'
    When 3 Then 'Local Disk'
    When 4 Then 'Network Drive'
    When 5 Then 'Compact Disk'
    Else 'RAM Disk'
  End As DriveType,
  Cast(tblVolume.FreeSpace / 1024 / 1024 / 1024 As numeric) As FreeGB,
  tblVolume.Capacity,
  Cast(tblVolume.Capacity / 1024 / 1024 / 1024 As numeric) As TotalSizeGB,
  tblVolume.Automount,
  tblVolume.BlockSize,
  tblVolume.Compressed,
  tblVolume.DeviceID,
  tblVolume.DirtyBitSet,
  tblVolume.ErrorCleared,
  tblVolume.ErrorDescription,
  tblVolume.ErrorMethodology,
  tblVolume.FileSystem,
  tblVolume.IndexingEnabled,
  tblVolume.PageFilePresent,
  tblVolume.SupportsDiskQuotas,
  tblVolume.SupportsFileBasedCompression,
  tblVolume.Lastchanged
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tblVolume On tblAssets.AssetID = tblVolume.AssetID
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
      tblAssets.LocationID
  Left Outer Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblState.Statename = 'Active' And Coalesce(tblVolume.DriveLetter, '') = '' and Coalesce(tblVolume.Label, '') = ''
Order By tblAssets.Domain,
  tblAssets.AssetName,
  VolumeName

 

View solution in original post

2 REPLIES 2
Gabriel-Chemie
Engaged Sweeper

It lists all the Servers with Unallocated Space. Many thanks !

Mister_Nobody
Honored Sweeper II

Try this:

 

Select Top (1000000) tblAssets.AssetID,
  tblAssets.AssetName,
  tblAssets.Domain,
  tblAssets.Username,
  tblAssets.Userdomain,
  Coalesce(tsysOS.Image, tsysAssetTypes.AssetTypeIcon10) As icon,
  tblAssets.IPAddress,
  tsysIPLocations.IPLocation,
  tblAssetCustom.Manufacturer,
  tblAssetCustom.Model,
  tsysOS.OSname As OS,
  tblAssets.SP,
  tblAssets.Lastseen As [Last successful scan],
  tblAssets.Lasttried As [Last scan attempt],
  tblVolume.Name As VolumeName,
  tblVolume.DriveLetter,
  tblVolume.Label As LogicalDiskName,
  Case tblVolume.DriveType
    When 0 Then 'Unknown'
    When 1 Then 'No Root Directory'
    When 2 Then 'Removable Disk'
    When 3 Then 'Local Disk'
    When 4 Then 'Network Drive'
    When 5 Then 'Compact Disk'
    Else 'RAM Disk'
  End As DriveType,
  Cast(tblVolume.FreeSpace / 1024 / 1024 / 1024 As numeric) As FreeGB,
  tblVolume.Capacity,
  Cast(tblVolume.Capacity / 1024 / 1024 / 1024 As numeric) As TotalSizeGB,
  tblVolume.Automount,
  tblVolume.BlockSize,
  tblVolume.Compressed,
  tblVolume.DeviceID,
  tblVolume.DirtyBitSet,
  tblVolume.ErrorCleared,
  tblVolume.ErrorDescription,
  tblVolume.ErrorMethodology,
  tblVolume.FileSystem,
  tblVolume.IndexingEnabled,
  tblVolume.PageFilePresent,
  tblVolume.SupportsDiskQuotas,
  tblVolume.SupportsFileBasedCompression,
  tblVolume.Lastchanged
From tblAssets
  Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID
  Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype
  Inner Join tblVolume On tblAssets.AssetID = tblVolume.AssetID
  Inner Join tsysIPLocations On tsysIPLocations.LocationID =
      tblAssets.LocationID
  Left Outer Join tsysOS On tblAssets.OScode = tsysOS.OScode
  Inner Join tblState On tblState.State = tblAssetCustom.State
Where tblState.Statename = 'Active' And Coalesce(tblVolume.DriveLetter, '') = '' and Coalesce(tblVolume.Label, '') = ''
Order By tblAssets.Domain,
  tblAssets.AssetName,
  VolumeName