Need help to get Disk I/O of all disks in a server

  • Hello Friends,

    Can someone please give me the command to get me the Disk name and Disk I/O on a windows 2012 server using powershell

  • Here is some code I use. Hope it helps.

    $Drives = Get-WmiObject -Class Win32_Volume -ComputerName $InstanceName -Filter "DriveType = 3" | Where-Object { $_.Name -notlike "\\?\Volume*" } | Sort-Object Caption

    $Drives = $Drives | SELECT @{n='ServerName';e={$_.__SERVER}}, @{Name='DriveType';e={$_.DriveType}}, @{n='DriveName';e={$_.Name}}, @{n='VolumeName';e={$_.Label}}, `

    @{n='PercentFree';e={"{0:n2}" -f ($_.FreeSpace/$_.Capacity*100)}}, `

    @{n='SizeGB' ;e={"{0:n2}" -f ($_.Capacity/1gb)}}, `

    @{n='FreeSpaceGB';e={"{0:n2}" -f ($_.FreeSpace/1gb)}}, `

    @{Name='Message';Expression={IF($_.Capacity) {""} ELSE {"Volume information is not available"} }}

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply