Disk Space Report - Reports only disks that are below a threshold - HTML output.

I have created a Powershell script to report on a list of server's disks space.  Unlike most reports out there, this one only reports on those disks that are below the set thresholds.  My previous attempt at this saved the results to a CSV file, attached to an email and sent out

 
 
 
 
 
4.7 Star
(13)
15,139 times
Add to favorites
Storage
8/12/2011
E-mail Twitter del.icio.us Digg Facebook
  • Add servers to exclusion list
    1 Posts | Last post October 13, 2016
    • Awesome script!!  Thank you for sharing.  Is there a way to add some servers to an exclusion list for notifications?  I have some legacy servers we know the disk space is an issue but we can do nothing about it because of limitations of the OS (cough Windows 2003).
      
      Thank again!
  • Only Outputing 1 Drive
    1 Posts | Last post October 13, 2016
    • I'm only getting output of 1 drive per server, there are multiple drives and they should be showing up.  
  • How do I format the server_c.txt file?
    2 Posts | Last post October 05, 2016
    • It would be real great if you could mention what format the file is for the server names.
      I've tried so many iterations of making a file for the server names and I keep getting an error:
      
      Get-Content : Cannot find path 'J:\Batch\servers_c.txt' because it does not exist.
      At J:\Batch\Greg_DiskSpace2.ps1:56 char:14
      + $computers = Get-Content "servers_c.txt";
      +              ~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : ObjectNotFound: (J:\Batch\servers_c.txt:String) [Get-Content], ItemNotFoundException
          + FullyQualifiedErrorId : PathNotFound,Microsoft.PowerShell.Commands.GetContentCommand
    • Dude, what you should do is create the directory J:\Batch\ a TXT file with the name servers_c , within that new notepad you put the name of your computer or server.
  • Display all drive even if it is not low
    1 Posts | Last post May 14, 2016
    • What modifications can I make in the script to get Display all drives even if it is not low
  • Unexpected token 'computer'
    1 Posts | Last post March 11, 2016
    • Hi, thanks for the super script, i am facing a error while running manually,
      ------------------------------
      Unexpected token 'computer' in expression or statement. 
      at D:\Job\DiskSpaceQuery\Reports\diks_space_report.ps1:170 char50
      + Write-Host -ForegroundColor DarkYellow "$computer $deviceID percentage free space = $percentFree";
      + Category info : Parse error:<computer:String> [], Parse exception
      + fully qualified ErrorId : Unexpectedtoken
      -----------------------------------------
      
      can you please suggest on above error
  • All drives and mount path not showing
    1 Posts | Last post March 08, 2016
    • I ran this script i only getting the report of C:. I need to report for all the drives with mount path. Kindly explain how i get the same
  • Powershell version 4.0 & Get-WMIobject / Get-Ciminstance
    1 Posts | Last post January 25, 2016
    • I have a server running Windows 2003 Powershell 2.0 and when running the following line | Get-WmiObject -ComputerName remotemachine -Class Win32_LogicalDisk -Filter "DriveType = 3"  on remote machine it returns successful data.  When on Windows server 2012 R2 Powershell 4.0 , the same command return and error "The RPC server is unavailable.  So I replaced Get-wmiobject with Get-ciminstance and now I receive the error "The WInRM client received an HTTP bad request status (400) but the remote service did not..." I can telnet successfully to this machine. 
      Any ideas why I'm receiving this error under Powershell 4.0 to the remote machine. 
      
      Thanks
      Ron
  • getting following error, also please provide the servers input text file you are using as a refrence
    1 Posts | Last post September 30, 2015
    • Get-WmiObject : Access is denied. (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED))
      At C:\Users\administrator\Desktop\disk space monitoring\diskspacereport.ps1:27 char:20
      + $data=Get-WmiObject <<<<  -Class Win32_logicaldisk -filter "drivetype=3" -computer $computers
          + CategoryInfo          : NotSpecified: (:) [Get-WmiObject], UnauthorizedAccessException
          + FullyQualifiedErrorId : System.UnauthorizedAccessException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
  • Individual adding different server warning level
    1 Posts | Last post September 07, 2015
    • How to include of warning level size in servers_c.txt
      let each server can be different warning level?
      Please help
      
      Warning level can be disk free space.
      
  • Added Green Status for Normal to Show All disks
    2 Posts | Last post August 26, 2015
    • Make the following changes
      Line 27 $percentNormal = 99;
      Line 52 $GreenColor = "#00CC00"
      Line 149 - 155
      If ($percentFree -lt $percentWarning)
          {$color = $orangeColor} 
          ElseIf ($percentFree -lt $percentCritcal)
          {$color = $redColor} 
          Else
          {$color = $GreenColor}
          # Set background color 
      
      Line 179 <td width='10%' align='center' bgcolor='#00CC00'>Normal less than 95% free space</td>
      
      It might also be nice to move all variables to the top of the script so that a newbie can come in and change the all the settings needed. 
      
      Also as mentioned, i would add as a comment towards the top about creating the servers_c.txt file and the path to the file. 
      
    • Line 147 
      $usedSpaceGB = [Math]::Round($sizeGB - $freeSpaceGB, 2);
11 - 20 of 39 Items