FailoverCluster: Configure Role (foreach VM): Unterschied zwischen den Versionen

Aus Wiki-WebPerfect
Wechseln zu: Navigation, Suche
(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…“)
 
 
Zeile 3: Zeile 3:
 
*Run the following foreach-loop:
 
*Run the following foreach-loop:
 
<source lang="powershell">
 
<source lang="powershell">
foreach ($vm in $vms) {
+
$VMs = (Get-VM).Name
Get-vm $vm | Add-ClusterVirtualMachineRole
+
 
 +
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
}