Use below command if you want to get the CPU utilization of remote machine from command prompt. It’s very useful if you don’t want to spend time in logging on to the server to verify the stats. Needless to say, replace RemoteMachine with your remote machine name in below command.
typeperf “\RemoteMachineprocessor(_Total)% Processor Time”
Refer to my old article to know more about typeperf
You can also very easily build your own performance monitor in C++
Windows C++ Get CPU and Memory Utilisation With Performance Counters
Using the command provided, it is possible to get data from Local machine only.
But when tried with remote machine, it returns following error:
Error: No valid counters.
typeperf “\Process(*)% Processor Time” -sc 1
Please help me out in this issue.
Let’s isolate the problem this way. Execute this command on the remote machine locally and see if it returns any thing. If the comman works fine locally, then we have some thing to troubleshoot with remote connection.
Make you sure that you are having admin rights on remote machine while running this command. A domain admin is preferred for ideal results.
Seems like that you’ve put lots of hard work into your article and I require much more of these on the net these days. I sincerely got a kick from your post. I don’t really have significantly to express in response, I only wanted to comment to reply amazing work.
Is there a way to run these queries using SQL XP command shell to remotley collect data within SQL server Queries? And is there an easy way to pass alternative credentials to be used?
Mark, If you are running SQL 2008, then you can use a powershell script instead of XP Command shell. I guess whatever the logging you are using through XP shell can be converted into powershell code. Alternative is, to write a VB script that can query remote WMI to get current CPU utilization.
I recently wrote a PowerShell script that queries CPU utilization using WMI (http://techibee.com/powershell/get-cpu-utilization-of-a-computer-using-powershell/996). You can convert into VBScript.
Let me know if you need any help here.
I want to write a powershell script that will run on one machine and retrieve information on CPU usage from two remote machines. When the CPU usages goes, lets say over 20% I want to know what the first 10 highest processes are running and send that information to a text file on the machine that initiated the retrieval command. I would like the script to run every 5 minutes or so for 30 minutes. I have a Windows Server 2012 VM, a Windows 8.1 VM and a Windows 10 VM machine running. Both 8.1 and 10 clients are on my domain on the Server 2012. Can you help me? Thank you! Steve
I have tried but it is telling that invalid command.
Can anyone tell me how to view the cpu and memory load of a remote machine connected in the network.
You may want to try some PS code. http://techibee.com/powershell/get-cpu-utilization-of-a-computer-using-powershell/996