August 1, 2016 at 12:44 am
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
August 25, 2016 at 11:55 am
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 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy