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.