Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
add comment

1 Answer

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
add comment

Your Answer

 
discard

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.