![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| Guest | PerfMon PowerShell Query Below code checks the perfmon counter and gives me the value of a instance =============================== Function PerfMon($Server) { $Ojbect = "LogicalDisk" $Counter = "% Free Space" $Instence = "C:" $perf = New-Object System.Diagnostics.PerformanceCounter($Ojbect, $Counter, $Instence, $Server) $p = $perf.RawValue $p } $Computer = "ww" PerfMon $computer =============================== Is there any way to do a query for all instance of a counter and object and give a value of those? Eg. Script does a query for all available instances (_total, c:, d:, e: etc..) itself instead of defining a value like $instence = “c:” and gives the value of all. Any help greatly appreciated. |
My System Specs![]() |
| | #2 (permalink) | ||||||||||||
| Guest | Re: PerfMon PowerShell Query
$perfc = New-Object System.Diagnostics.PerformanceCounterCategory $perfc.categoryname="LogicalDisk" $perfc.GetInstanceNames() Marco -- Microsoft MVP - Windows PowerShell http://www.microsoft.com/mvp PowerGadgets MVP http://www.powergadgets.com/mvp Blog: http://marcoshaw.blogspot.com | ||||||||||||
My System Specs![]() | |||||||||||||
| | #3 (permalink) | ||||||||||||||||||||||||||||||||||||||||||||||||
| Guest | Re: PerfMon PowerShell Query Perfectly what I want. Thanks a lot... On May 15, 10:44*am, "Marco Shaw [MVP]" <marco.shaw@_NO_SPAM_gmail.com> wrote:
| ||||||||||||||||||||||||||||||||||||||||||||||||
My System Specs![]() | |||||||||||||||||||||||||||||||||||||||||||||||||
![]() |
| Thread Tools | |
| Display Modes | |
| |
Similar Threads | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| LDS query via powershell | H4mm3r | PowerShell | 12 | 07-09-2008 05:53 AM |
| Translate WMIC query to Powershell | Chad | PowerShell | 0 | 12-06-2007 12:24 PM |
| Running WMI Query in without Powershell or VBS | greatbarrier86 | PowerShell | 5 | 08-23-2007 01:58 AM |
| Query NT4 Domain from Powershell | Gaurhoth | PowerShell | 1 | 01-16-2007 03:37 PM |
| Query for ms-ds-creatorsid from Powershell | gaurhoth | PowerShell | 6 | 11-04-2006 03:42 PM |