Board logo

subject: Monitor System Performance with Windows PowerShell [print this page]


Monitor System Performance with Windows PowerShell

Windows PowerShell is Microsoft's task automation framework, consisting of a command-line shell and associated scripting languagebuilt on top of, and integrated with, the .NET Framework. PowerShell provides full access to COM and WMI enabling administrators to perform administrative tasks on both local and remoteWindows Systems. Of course, one of the useful feature in Windows 7 is Windows PowerShell for gathering performance data. Here are the three new Windows PowerShell cmdlets provide functionality as follows:

Export-counter Imports performance counter log files and creates objects that represent each counter sample in the log.

Import-counter Exports PerformanceCounterSampleSet objects as performance counter log (.blg, .csv, .tsv) files.

Get-counter Gets real-time performance counter data from local and remote computers.

For instance, the following Windows PowerShell command gets the current "% Processor Time" combined values for all processors on the local computer every 2 seconds until it has 100 values and displays the captured data: PS C:Usersmallen>Get-counter -Counter "Processor(_Total)\% Processor Time" -SampleInterval 2 -MaxSamples 100

The following command continuously gets the current "% Processor Time" combined values for all processors on the local computer every second (the default sampling interval) and displays the captured data until you press CTRL+C: PS C:Usersmallen>Get-counter -Counter "Processor(_Total)\% Processor Time" Continuous

Of course, you can pipe the output of the Get-counter cmdlet into the Export-counter cmdlet.For example, the following command gets the current "% Processor Time" combined values for all processors on the local computer every 2 seconds until it has 100 values and exports the captured data as a performance counter log file named Data1.blg, which is saved in the current directory (here the root folder of user Michael Allen's user profile): PS C:Usersmallen>Get-counter "Processor(*)\% Processor Time" -SampleInterval 2 -MaxSamples 100 | Export-counter -Path $homedata1.blg

Also you can also pipe the output of the Import-counter cmdlet into the Export-counter cmdlet. You might do this, take an example, to convert a performance monitor log file from one format to another, such as from .csv to .blg format.

IfyoualsohavesomequestionsoryouwanttodownloadthesoftwaresImentionedabove,

youcanvisittheoriginalarticlefrom:

http://www.newton360.com/Detail/Monitor-System-Performance-with-Windows-PowerShell.html

Welcometohttp://www.newton360.com togetmoreinformatin,includingWindows7tips,

news,wallpapersandsoftwares...etc.




welcome to loan (http://www.yloan.com/) Powered by Discuz! 5.5.0