$Head = "
<title>Exchange Dashboard</title>
<style type='text/css'>
body { background-color: honeydew; }
table {
border-width: 1px;
border-style: solid;
border-color: black;
border-collapse: collapse;
}
th {
border-width: 1px;
padding: 0px;
border-style: solid;
border-color: black;
background-color:lawngreen;
}
td {
border-width: 1px;
padding: 0px;
border-style: solid;
border-color: black;
background-color: palegreen
}
</style>"
$Computers = 'server1', 'server2'
$Computers | ForEach-Object {
Get-WMIObject Win32_LogicalDisk -ComputerName $_ -Filter "DriveType=3" |
Select-Object `
SystemName, Name,
@{n='Free Space';e={ '{0:N}' -f ($_.FreeSpace / 1Gb) }},
@{n='Disk Size';e={ '{0:N}' -f ($_.Size / 1Gb) }},
@{n='Percent Free';e={ '{0:P2}' -f ($_.FreeSpace / $_.Size) }}
} | Sort-Object "Percent Free" -Descending |
ConvertTo-Html -Head $Head |
Out-File C:\Scripts\Exchangedashboard.html
|