‎01-27-2022 11:26 PM
‎02-01-2022 01:48 PM
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="LS.Enums" %>
<%@ Import Namespace="LS" %>
<% Response.CacheControl = "no-cache";%>
<% Response.AddHeader("Pragma", "no-cache"); %>
<% Response.Expires = -1; %>
<% LS.User.Current().CheckUserWebsiteAccess(); %>
<%var dsAssets = DB.ExecuteDataset("Select Top 1000000 tblAssets.AssetID, tblAssets.AssetName, tsysOS.OSname As OS, tblAssets.SP, Cast(tblDiskdrives.Freespace / 1024 / 1024 / 1024 As numeric) As FreeGB,Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) As TotalSizeGB, Ceiling(tblDiskdrives.Freespace / (Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size End) * 100) As [%SpaceLeft],tblDiskdrives.Lastchanged As LastChanged From tblAssets Inner Join tblDiskdrives On tblAssets.AssetID = tblDiskdrives.AssetID Inner Join tblComputersystem On tblAssets.AssetID = tblComputersystem.AssetID Inner Join tblAssetCustom On tblAssets.AssetID = tblAssetCustom.AssetID Inner Join tblState On tblState.State = tblAssetCustom.State Inner Join tsysAssetTypes On tsysAssetTypes.AssetType = tblAssets.Assettype Inner Join tsysIPLocations On tsysIPLocations.LocationID = tblAssets.LocationID Inner Join tblDomainroles On tblDomainroles.Domainrole = tblComputersystem.Domainrole Left Join tsysOS On tblAssets.OScode = tsysOS.OScode Where Cast(tblDiskdrives.Size / 1024 / 1024 / 1024 As numeric) <> 0 And Ceiling(tblDiskdrives.Freespace / (Case tblDiskdrives.Size When 0 Then 1 Else tblDiskdrives.Size End) * 100) < 10 And tblState.Statename = 'Active' And tblDomainroles.Domainrolename In ('Stand-alone server', 'Member server', 'Primary domain controller', 'Backup domain controller') And Case tblDiskdrives.DriveType When 3 Then 'Local Disk' End = 'Local Disk' Order By tblAssets.Domain, tblAssets.AssetName, tblDiskdrives.Caption");
if (dsAssets.Rows.Count != 0)
{%>
<table width="400" border="0" cellpadding="0" cellspacing="0">
<tr><td>Asset</td><td>Free GB</td><td>Total Size (GB)</td></tr>
<% foreach (DataRow myrow in dsAssets.Rows)
{%>
<tr>
<td align="left" ><a href="<%=ResolveUrl("~/")%>asset.aspx?AssetID=<%:myrow["AssetID"]%>"><%: myrow["AssetName"] %></a></td>
<td align="left" valign="top"><%: myrow["FreeGB"] %></td> <td align="left" valign="top"><%: myrow["TotalSizeGB"] %></td>
</tr>
<% }%>
</table>
<%if (LS.User.Current().IsInRole(Permission.EditConfiguration)){%><div style="float:right"><a href="<%=ResolveUrl("~/")%>configuration/AssetGroups/" class="sml">config</a></div><% } %>
</div>
<%}%>
Experience Lansweeper with your own data. Sign up now for a 14-day free trial.
Try Now