Powershell Script to Get CPU,Memory and C Drive utilization(Server Health Check)

Hi, I wrote a simple powershell script to get CPU Load, Memory utilization and C drive Utilization for a list of servers from a text file. So, this script takes servers from a text file and the result will be displayed in a HTML file and Sends email. 

HealthCheck.ps1
 
 
 
 
 
4.3 Star
(23)
24,571 times
Add to favorites
3/25/2014
E-mail Twitter del.icio.us Digg Facebook
  • I have list of 7 servers but i am getting report for only 3 servers
    1 Posts | Last post August 22, 2019
    • Hi All,
      
      I am new to scripting environment and I am getting html file for only 3 servers.
      Rest 4 servers are blank in table only with % sign.
      Even I am getting error as
      
      Get-WmiObject : The RPC server is unavailable.
      At C:\Users\v-nikhlk\Desktop\HealthCheck.ps1:14 char:12
      + $AVGProc = Get-WmiObject -computername $computername win32_processor  ...
      +            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
          + CategoryInfo          : InvalidOperation: (:) [Get-WmiObject], COMException
          + FullyQualifiedErrorId : GetWMICOMException,Microsoft.PowerShell.Commands.GetWmiObjectCommand
      
      Any help from anyone will be appreciated
  • can powershell script check CPU usage if 99%, restart the service?
    1 Posts | Last post June 04, 2019
    • can powershell script check CPU usage if 99%, auto STOP and START the service (local)?
      
      How we do that?
  • Get Same Result for last 7 days
    1 Posts | Last post April 21, 2019
    • Hello Sravan , Thanks for the nice script but I was wondering if I can get same result but for the last 7 days?
  • is that any way to get other drive details and to generate report in ++ date
    1 Posts | Last post May 07, 2018
    • Hi Sravan Its very useful however i am not good in scripting so can i ask for help to get other drive details and get report date wise using same script. Also i am getting RPC error while running in most of the server. is there any way to avoid error and get report? let me know thanks.
  • please help with Powershell script to find CPU, memory and diskspace along with ping status( host up or not) for multiple windows server
    1 Posts | Last post April 09, 2018
    • Hi
      I am new to scripting... need help with find CPU, Memory, Disk space( both c and d drive and also host is up or not with threshold showing red else green. I have used same script as posted in original blog I am getting and empty email, not any html table... do i need access to windows servers with admin rights? for server mentioned in serverlist.txt? and can we do check for servers on different domains? please help.
  • How can i refresh the same html file every 60 seconds
    1 Posts | Last post March 14, 2018
    • Hello Sravan,
      
      Hope you are doing well.
      
      I need to place in a monitoring system which is connected to Large display monitor. 
      
      Instead of sending on email i wanted to refresh the page every 1 min and status should get in in html page. please help.
  • Utlization of all Drives
    1 Posts | Last post February 23, 2018
    • Hello, If we need utilization for all Drives
  • How to get same details for servers in different domain
    1 Posts | Last post February 11, 2018
    • Hi Sravan,
      
      Script works perfectly for the servers within the same domain and it is taking credentials from system.
      How do i run this scripts for servers in different domain?
      
  • Script Row Output Color
    2 Posts | Last post January 30, 2018
    • The script is working great and I have it working with email. However, when it is displayed every row in the table is highlighted in red regardless of whether or not the CPU Usage or Memory Usage is over 80% for the machine in that row. Do values get rounded up and truncated to ints automatically in powershell or could something else be the problem?
    • Nevermind I looked further down in the posts and found the answer.
  • Not Working
    1 Posts | Last post January 17, 2018
    • Script executed succesfully but no data is availabl in HTML file. How to add data in server.txt
1 - 10 of 38 Items