Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How to schedule performance counter in multiple Windows Server 2008 R2 to start on Monday morning 8 AM and stop at 6 PM on Friday ?

for the following metrics: CPU usage, Disk usage, Memory, Network, Queue, Database processes

Because when I do it manually one by one it would be to daunting and slow process.


share|improve this question
up vote 1 down vote accepted

Set a scheduled task to run a script using your credentials to run the script and output to xml or clixml. You can distribute the tasks on each server and save the outputted data to a share (easer to scale out this process) or run it from one server and get the data remotely. You can wrap you code inside the following scriptblock.. By doing this you can scale out your task by getting many dozens or servers to return data in parallel. This I think is one of the most powerful commands that PowerShell has to offer to allow you to scale out an operation to hundreds or thousands of servers.

Invoke-Command -ComputerName (get-content C:\computerlistwith5000servers.txt) -ThrottleLimit 100 -ScriptBlock {1 to 500+ lines of code  end code with a return statement returing your outputed values.}
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.