Basic Resource Monitor

I needed a quick way to check CPU load and memory usage on a few servers. First you will need to create a serverlist of all the servers you want to check the resources on. I have a text file in same location as script named "ResourceMonitorServerList.txt" The servers in the text file need to be the FQDN -- server1.domain.local -- Also needed is a location for the transcript file created by the script.

Also you will have to enable Powershell remoting on the other Servers so the script can access them on the other servers run powershell as admin and this command Enable_PSRemoting

First thing the script does is read the server list and then for each server gets the name, CPU average, free memory, and total memory. It writes that to the console and to the transcipt file. At the time of writing this script I needed a way to get all console output to a local file and this was the easiest solution for me. After it checks all the servers it reads the transcript looking for the String "WARNING" and takes that selection and emails it. It is super basic and does the job for me.

Sorry for double post
  • Hi


    from doing a quick search I think you could use

    (gwmi win32_pagefileusage).AllocatedBaseSize


    (gwmi win32_pagefileusage).CurrentUsage

    I have not tested or tried anything but this should get you going in the right direction.

    Good Luck

  • Hi that's nice :)

    Now hope you don't mine me asking but i'm looking for a way to find out what size the pagefile of a server is set to compared to the amount of physical RAM it has. The reason i'm seeking this is i have servers that should have their page file set manually to 1.5x RAM or 2X RAM etc. so if i could run a command that could tell me this it would be helpful. Do you think you could do such a thing?

  • Sorry I had a few things backwards in script  hopefully I have fixed it.  I uploaded edited version.  Thats what i get for trying to make it more readable.