【问题标题】:Powershell Command to determine the Free Space of a Cluster Shared Volumes on a Remote Windows Server用于确定远程 Windows 服务器上集群共享卷的可用空间的 Powershell 命令
【发布时间】:2014-02-12 03:33:38
【问题描述】:
我正在寻找一个 powershell 命令,该命令将提取集群共享卷的可用空间,因为它在远程系统上没有逻辑驱动器号。以下是我在逻辑驱动器上使用的命令,因此您可以看到我正在寻找的输出示例。我正在寻找可用兆字节的数值。
Get-WMIObject -computer server -filter "DeviceID = 'C:'" Win32_LogicalDisk |
ForEach-Object {[math]::truncate($_.freespace / 1MB)}
提前感谢您的帮助!
【问题讨论】:
标签:
windows
powershell
cluster-computing
hyper-v
diskspace
【解决方案1】:
您无法根据每个主机确定集群共享卷 (CSV) 的可用空间。 CSV 是集群共享资源,因此您需要使用cluster tools 获取有关它们的信息:
$cluster = 'Cluster Name'
$volume = 'Cluster Shared Volume Name'
Import-Module failoverclusters
Get-ClusterSharedVolume -Name $volume -Cluster $cluster `
| select -Expand SharedVolumeInfo `
| select @{n='FreeSpace';e={($_.Partition.Size - $_.Partition.UsedSpace)/1MB}}