I would like to start the cluster resources 5 at a time only

时间:2017-10-12 09:38:28

标签: powershell

We had a 4 Hyper-V clusters with 2012 R2 and VM's are running on it.

I would like to start the cluster resources 5 at a time only and i had tried following command as per MS but it is not working as expected.

instead of 5 Vm it is starting all VM's any help appreciated

Get-Cluster -name cluster1 | Get-ClusterResource | where { $_.Name -and $_.state -eq "offline"} –ob 5 | Start-ClusterResource 

1 个答案:

答案 0 :(得分:0)

I've not got a HyperV Cluster to test this on, but Select-Object -First 5 will select only 5 of the returned Cluster Resources:

Get-ClusterResource -Cluster cluster1 | where { $_.State -eq "Offline"} | Select-Object -First 5 | Start-ClusterResource