logical disks

rated by 0 users
This post has 7 Replies | 2 Followers

Top 200 Contributor
Posts 9
Repriser Posted: 04-22-2011 10:10 AM

If I run ps script like the following, would I get consistent reliable info about my logical disks? I got percentdisktime, but other values are zero or strange long digits.

 

$computer = "hostname"
$namespace = "root\CIMV2"
Get-WmiObject -class Win32_PerfFormattedData_PerfDisk_LogicalDisk -computername $computer -namespace $namespace

Top 25 Contributor
Posts 281
Top Contributor

You can get some data with:

$obj = new-object -com Scripting.FileSystemObject

$drive = $obj.getdrive("c")

$drive

Top 200 Contributor
Posts 9

Felipe, your post is irrelavent.

You need to understand what is logical disk before you reply.

Try run the script I post first.

Post a lot but trade off quality is no good.

Top 25 Contributor
Posts 281
Top Contributor

Well nobody have ever complained...

I was trying to point you in another direction..

Some of the information you get querying directly a specified volume is not there when you run your script.

Maybe somebody else can help you.

Top 200 Contributor
Posts 9

Nobody complained because you are forgiven and forgotten.

Top 10 Contributor
Posts 597
Microsoft MVP
Top Contributor

This is a free forum, and we all here provide answers in our spare time. I am sure we all try and help as best as we can.

So I'd ask everyone to show due respect.

To answer part of your question: performance counters deliver real time performance data. So if you did not read anything from a particular disk lately, the values are zero. Long digits represent raw data that may be measured in ticks which are very small time units. Empty properties may result from missing access privileges (you may need to run the code as Admin), or missing media (no disk inserted).

Top 200 Contributor
Posts 9

Thanks. That is on target.

It will be nice there is an official documentation that explains what it returns. Some counters are cumulative data, some are absolute measures. I am using admin privilege and with real disks.

Since powershell left the guessing game to us, I am switching back to perfmon output into a table.

$computer = "hostname"
$namespace = "root\CIMV2"
Get-WmiObject -class Win32_PerfFormattedData_PerfDisk_LogicalDisk -computername $computer -namespace $namespace

Another point to prove powershell is re-inventing wheel and not very useful at times.

  • Filed under:
Top 200 Contributor
Posts 9

Certain part of powershell is just not there yet. Missing features, for example,

$computer = "hostname"
$namespace = "root\CIMV2"
Get-WmiObject -class Win32_PageFile -computername $computer -namespace $namespace

My initial hope was PS can match up perfmon, therefore we have a way to verify data on a second source. And, I can program PS to retrieve data into data management warehouse.

Unfortunately, time after time, it is not available. I am going to leav this topic now with my heart broken by Powershell. You enthusiasts can continue.

Carry on. Pal.

Page 1 of 1 (8 items) | RSS
Copyright 2012 PowerShell.com. All rights reserved.