FailoverCluster: Configure Role (foreach VM): Unterschied zwischen den Versionen
Aus Wiki-WebPerfect
Admin (Diskussion | Beiträge) (Die Seite wurde neu angelegt: „== Configure Role for all VMs on a Hyper-V Node == *First connect to the Hyper-V node *Run the following foreach-loop: <source lang="powershell"> foreach ($vm…“) |
Admin (Diskussion | Beiträge) |
||
Zeile 3: | Zeile 3: | ||
*Run the following foreach-loop: | *Run the following foreach-loop: | ||
<source lang="powershell"> | <source lang="powershell"> | ||
− | foreach ($vm in $ | + | $VMs = (Get-VM).Name |
− | Get- | + | |
+ | foreach ($vm in $VMs) { | ||
+ | Get-VM $vm | Add-ClusterVirtualMachineRole | ||
} | } | ||
</source> | </source> | ||
− | |||
− | |||
− | |||
Aktuelle Version vom 27. September 2019, 10:18 Uhr
Configure Role for all VMs on a Hyper-V Node
- First connect to the Hyper-V node
- Run the following foreach-loop:
$VMs = (Get-VM).Name foreach ($vm in $VMs) { Get-VM $vm | Add-ClusterVirtualMachineRole }