To start or stop VMs (W7SQLH2V1 - W7SQLH2V3)
1. Start VMs
$VM = Get-VM -Name "W7SQLH2*"
Foreach ($iVM in $VM)
{
Start-VM -VM $iVM
}
2. Stop VMs
$VM = Get-VM -Name "W7SQLH2*"
Foreach ($iVM in $VM)
{
Stop-VM -VM $iVM
}
3. Stop a classroom and then start another classroom
$VM1 = Get-VM -Name "W7SQL*"
Foreach ($iVM in $VM1)
{
Stop-VM -VM $iVM
}
$VM2 = Get-VM -Name "W7eclipse*"
Foreach ($iVM in $VM2)
{
Start-VM -VM $iVM
}
4. VMM 2008 Module import
Add-PSSnapin Microsoft.SystemCenter.VirtualMachineManager
Get-VMMServer -ComputerName serverRealName
$VM2 = Get-VM -Name "W7eclipse*"
Foreach ($iVM in $VM2)
{
Stop-VM -VM $iVM
}
沒有留言:
張貼留言