1

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.

Thanks.

Senior Systems Engineer
  • 1,275
  • 2
  • 33
  • 62

1 Answers1

1

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.}
jamason1983
  • 176
  • 4